Commit graph

185 commits

Author SHA1 Message Date
Richard Feldman
56df170be6 Reproduce parsing failure on [ ] 2019-12-31 20:20:58 -05:00
Chad Stearns
844ca0a50e Changed instances of 'Case' in the code to 'When' 2019-12-23 17:41:19 -05:00
Chad Stearns
62a004c103 Case is to when is 2019-12-23 17:17:04 -05:00
Chad Stearns
9a5b6a03b4 case when to case is 2019-12-23 17:08:53 -05:00
Richard Feldman
d0fa8bf857 Use commas between function arguments 2019-12-18 21:50:45 -05:00
Richard Feldman
d73b8ca1fc Remove UnqualifiedIdent 2019-12-16 21:29:03 -05: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
37422c6a76 Add failing tests for hex/octal/binary 2019-12-07 02:26:08 -05:00
Richard Feldman
ba92480d97 Reorganize can/ module 2019-12-05 19:51:56 -05:00
Richard Feldman
b3bdbd9d98 Reproduce subtraction parsing bug 2019-12-05 19:31:10 -05:00
Richard Feldman
59dc729209 Fix unicode parsing bug. 2019-12-04 21:29:50 -05:00
Richard Feldman
1d18f4cc85 Use private/global tags and Access over Field 2019-12-02 18:36:59 -05:00
Richard Feldman
be1e83dd6d Use crate:: prefix a bunch. 2019-11-27 22:11:40 -05:00
Richard Feldman
b2e19ffe72 Reproduce failing module_defs parse 2019-11-27 21:14:22 -05:00
Richard Feldman
145d985c2d Add failing test for nested module parsing 2019-11-27 17:21:08 -05:00
Richard Feldman
4926bfbc3a Reorganize fmt and module 2019-11-25 20:42:44 -05:00
Richard Feldman
8e0fb89f66 Introduce Expr::ParensAround 2019-11-22 00:21:32 -05:00
Folkert
848b067556 allow pattern matching on records
there are a couple of cases here that are interesting:

- assigned fields, like `{ x: y }` should never occur as a pattern.
- what whitespace can occur now that block comments are removed? In elm, record patters have to be on a single line. For instance this gives a parse error:

```elm
type alias Model =
    { count : Int, value : Int }

x model =
    case model of
        { count
          -- bar
        , value
        }
        ->
            2
```

but its equivalent in Roc with the current parser accepts both newlines and
line comments in record patterns, so this is accepted:

```
x model =
    case model with
        { count
          # bar
        , value
        }
        ->
            2
```

That seems fine, but just want to
check that is desired.
2019-11-20 14:51:06 +01:00
Richard Feldman
60ee53080a Reproduce malformed argument bug 2019-11-16 22:39:25 -05:00
Richard Feldman
3a4bc0b311 Test unary ops with parens 2019-11-08 00:09:38 -05:00
Richard Feldman
97d424f99b Unary ops and case canonicalization compile! 2019-11-08 00:07:32 -05:00
Richard Feldman
7ab7fdb88c Add unary operators 2019-11-04 21:25:55 -05:00
Richard Feldman
7e910532c5 Fix parsing for case-expresison number literals 2019-10-30 20:00:35 +01:00
Richard Feldman
61e4ae83d9 Restore two_branch_case test 2019-10-30 19:58:21 +01:00
Richard Feldman
39f4057dfa Fix column number in some parsing tests 2019-10-30 02:36:35 -04:00
Richard Feldman
abdc19cf8e Fix some test compilation errors 2019-10-29 18:26:18 -04:00
Richard Feldman
f738d9db80 Revise Def structure 2019-10-26 15:31:39 -04:00
Richard Feldman
eeb2bb376c Code gen ints and floats 2019-10-21 20:12:37 -04:00
Richard Feldman
59bdb21ea2 First pass at parsing case. 2019-10-14 19:43:03 -04:00
Richard Feldman
ebaed27193 Parse if and args w/ idents, format w/ parens 2019-10-04 11:50:19 +03:00
Richard Feldman
8c9041685c Fix even more indentation checking 2019-10-02 15:20:41 +03:00
Richard Feldman
4dddea0bb1 Fix indentation checking some more 2019-10-01 21:07:19 +03:00
Richard Feldman
f96d3c7a02 Fix record descruturing in defs 2019-10-01 00:04:18 +03:00
Richard Feldman
1f178d7c1a Reproduce 2-def bug 2019-09-30 16:54:58 +03:00
Richard Feldman
7cdbd83ee8 Fix spaces around = in def 2019-09-29 22:44:10 +03:00
Richard Feldman
fda3d3056a Get basic def working 2019-09-29 22:32:02 +03:00
Richard Feldman
0696dad95c wip 2019-09-23 09:34:21 -04:00
Richard Feldman
9bf0d9477a Add failing test to parse underscores 2019-09-21 22:24:07 -04:00
Richard Feldman
b4b72179d6 Add test for 2-arg closure 2019-09-21 22:23:58 -04:00
Richard Feldman
2a80702a21 Parse closures 2019-09-21 20:31:24 -04:00
Richard Feldman
9ed55714c9 Make Spaceable trait to prepare for patterns 2019-09-19 23:53:56 -04:00
Richard Feldman
26eb76f785 Parse parenthetical expressions 2019-09-19 23:04:50 -04:00
Richard Feldman
122ab7c761 Add some failing paren tests 2019-09-19 00:15:21 -04:00
Richard Feldman
ea12e3e42f Add test for applying 2 args 2019-09-18 23:39:52 -04:00
Richard Feldman
be350020bd Rename parts to module_parts 2019-09-18 19:25:56 -04:00
Richard Feldman
8111cb0588 Add some field access tests 2019-09-18 19:25:20 -04:00
Richard Feldman
0cb5877c06 Add tests for qualified var/variant 2019-09-18 19:17:00 -04:00
Richard Feldman
f0b3970b54 Reorder Located::new args 2019-09-18 19:14:58 -04:00
Richard Feldman
4cb441fde3 Add test for comment after operator 2019-09-18 19:11:39 -04:00