Commit graph

14474 commits

Author SHA1 Message Date
Folkert
e5f2483ddc do what clippy wants 2019-12-13 23:17:03 +01:00
Folkert
fcb78787ad Tie the knot
Within parens, an expression can occur, creating a recursive grammer
like so:

term = * | Int | Bool | ... | ( expr )
expr = term, ..., term -> term | term

This means that a function type like

    (Int, Int -> Bool), Float -> Bool

is now parsed correctly
2019-12-13 23:06:00 +01:00
Folkert
35c8b9b5c9 Parse function type signatures 2019-12-13 22:52:49 +01:00
Folkert
502021d955 Always parse type signatures in let blocks.
Formerly, this would not parse

    foo : Int
    foo = 4

While this would

    bar = 3
    foo : Int
    foo = 4

Now, the first def can also be a type annotation.

This change performs some code duplication. This can probably be
abstracted/unified, but I'm not sure how to do that in a clean way.
2019-12-13 19:53:46 +01:00
Richard Feldman
dbea3324a3
Merge pull request #58 from rtfeldman/ct/format-new-line-before-return
Format new line before return value
2019-12-11 21:06:44 -08:00
Chad Stearns
31971bddab Imperative style implementation forr empty_line_before_expr 2019-12-11 14:00:13 -05:00
Chad Stearns
802a820699 Comply with clippy 2019-12-09 20:44:16 -05:00
Chad Stearns
86e393901f Merge branch 'ct/format-new-line-before-return' of github.com:rtfeldman/roc into ct/format-new-line-before-return 2019-12-09 17:33:24 -05:00
Chad Stearns
e0ca4ec355 Ran formatter 2019-12-09 06:41:42 -05:00
Chadtech
1a7b74cd3a
Merge branch 'trunk' into ct/format-new-line-before-return 2019-12-08 21:59:18 -05:00
Chad Stearns
2acbaf405c Pluralized variable name 2019-12-08 21:55:04 -05:00
Chad Stearns
3c8d678c18 New commented out test that is currently breaking under parser errors 2019-12-08 21:51:44 -05:00
Chad Stearns
6e91339700 Format code and tests for newline before return 2019-12-08 21:35:51 -05:00
Richard Feldman
045168c761
Merge pull request #57 from rtfeldman/record-wip
Groundwork for records and type aliases
2019-12-07 23:25:22 -05:00
Richard Feldman
7beca9e0fa cargo fmt 2019-12-07 23:08:36 -05:00
Richard Feldman
99b14aed27 Follow clippy's suggestions 2019-12-07 23:05:25 -05:00
Richard Feldman
f2f305b7a8 Clean up warnings 2019-12-07 23:05:25 -05:00
Richard Feldman
ca219a1b64 Record problems in unification 2019-12-07 23:05:25 -05:00
Richard Feldman
e949c56f70 Try out UnifyResult 2019-12-07 23:05:25 -05:00
Richard Feldman
0093298ed0 Get more of unification compiling 2019-12-07 23:05:21 -05:00
Richard Feldman
e831e165dd Add basic support for Record and Alias 2019-12-07 17:47:20 -05:00
Richard Feldman
cd09467a09 Remove stray dbg 2019-12-07 16:48:17 -05:00
Richard Feldman
b2ddcb8fb3
Merge pull request #56 from rtfeldman/fix-hex-parsing
Fix parsing hex/binary/octal literals
2019-12-07 06:49:24 -05:00
Richard Feldman
7f553be534
Merge branch 'trunk' into fix-hex-parsing 2019-12-07 02:29:58 -05:00
Richard Feldman
23ac81b7ae Restore Int.highest and Int.lowest 2019-12-07 02:29:30 -05:00
Richard Feldman
2710dcb95c Fix parsing hex/octal/binary literals 2019-12-07 02:27:12 -05:00
Richard Feldman
37422c6a76 Add failing tests for hex/octal/binary 2019-12-07 02:26:08 -05:00
Richard Feldman
12018a2fc8 Show expected vs actual in better order 2019-12-07 02:25:43 -05:00
Richard Feldman
c23270df5f
Merge pull request #55 from rtfeldman/infer-exposing
Infer types for exposed imports
2019-12-07 01:19:34 -05:00
Richard Feldman
92083e1e62 Relax some crate bounds 2019-12-07 01:18:08 -05:00
Richard Feldman
b79b10f4ec
Merge branch 'trunk' into infer-exposing 2019-12-07 01:07:11 -05:00
Richard Feldman
0b4be48a9b
Merge pull request #45 from rtfeldman/ct/comment-tests-and-new-line-tests
Format tests for comment position and new lines
2019-12-07 01:06:02 -05:00
Richard Feldman
5730ae250c Remove a .clone() - thanks, clippy! 2019-12-07 00:57:44 -05:00
Richard Feldman
ccc052d4ab cargo fmt 2019-12-07 00:57:09 -05:00
Richard Feldman
ba9cecdb79 Rename more envs to vars_by_symbol 2019-12-07 00:56:58 -05:00
Richard Feldman
2ffa16c1f2 Fix top-level defs bug 2019-12-07 00:56:32 -05:00
Richard Feldman
c30dd4bdf1 Replace .expect() with a panic 2019-12-07 00:48:01 -05:00
Richard Feldman
bfacfa729b Update comment 2019-12-07 00:40:57 -05:00
Richard Feldman
23c1a5587a Remove unnecessary flex_info addition 2019-12-07 00:38:29 -05:00
Chad Stearns
7bffda72ac Merge branch 'ct/comment-tests-and-new-line-tests' of github.com:rtfeldman/roc into ct/comment-tests-and-new-line-tests 2019-12-07 00:36:02 -05:00
Chad Stearns
85a6ba606b Merge branch 'trunk' of github.com:rtfeldman/roc into ct/comment-tests-and-new-line-tests 2019-12-07 00:35:19 -05:00
Chad Stearns
2b58604719 Deleted commented out failing tests, and ran cargo fmt 2019-12-07 00:34:56 -05:00
Richard Feldman
885d1b4475 Fix Dep3 shadowing 2019-12-07 00:34:36 -05:00
Richard Feldman
d86af21c7f Remove ExposedImport 2019-12-07 00:33:10 -05:00
Richard Feldman
6f9a9c6682 Rename RawVar to ExposedImport 2019-12-06 22:46:14 -05:00
Richard Feldman
9b853f62b1 Desugar exposed imports into the parse AST 2019-12-06 22:46:14 -05:00
Richard Feldman
34fd1c23bb Add failing test for exposing 2019-12-06 22:42:34 -05:00
Chadtech
965b60a749
Merge branch 'trunk' into ct/comment-tests-and-new-line-tests 2019-12-06 22:15:23 -05:00
Richard Feldman
f306b6f7dc
Merge pull request #49 from rtfeldman/infer-modules
Type check across modules
2019-12-06 21:09:06 -05:00
Richard Feldman
2b2edf1f5c Expand load_and_infer a bit. 2019-12-06 20:53:31 -05:00