Commit graph

14474 commits

Author SHA1 Message Date
Richard Feldman
ac5fb11a7a
Merge pull request #16 from rtfeldman/remove-gui
Remove obsolete gui/ directory
2019-11-20 17:58:16 -05:00
Richard Feldman
28fe01406b
Merge pull request #19 from rtfeldman/fix-parse-bug
Fix bug in parsing defs
2019-11-20 17:57:40 -05:00
Richard Feldman
b43f611ff0
Merge pull request #18 from rtfeldman/loc
Upgrade im_rc
2019-11-20 17:57:28 -05:00
Richard Feldman
a779c7613a Add note about upgrading Inkwell 2019-11-20 17:54:15 -05:00
Richard Feldman
f690b34dc7 Upgrade im_rc 2019-11-20 17:54:08 -05:00
Richard Feldman
8b543ef015 Clean up loc use in tests 2019-11-20 17:53:50 -05:00
Richard Feldman
a761bd29c4 Don't check trailing whitespace 2019-11-20 17:52:50 -05:00
Richard Feldman
9c006e8161 Indent function bodies 2019-11-20 17:52:50 -05:00
Richard Feldman
b3f7726a66 Fix defs parsing bug 2019-11-20 17:52:50 -05:00
Richard Feldman
c3ecac5abf Reproduce parsing bug 2019-11-20 17:52:50 -05:00
Folkert
b7a7dd9b37 remove spaces field from LabelOnly 2019-11-20 15:21:29 +01:00
Folkert
d3c14d16d1 parse all records as patterns
This makes the following parse

    # assuming
    Opaque : Opaque Int

    { x: (Opaque y) } = foo

In most cases a pattern of this kind will not be exhaustive, but it
should be syntactically valid.

Couple of things

- conversion of the value (in `key: value`) requires converting from
expr into a pattern, which returns a `Result` which now propagates. A
comment notes though that the cases for which it gives Err should not
parse. so, is the Result useful here?

- AssignedField constructors have a field for spaces, but also a
SpacesAfter constructor. Are they different? it seems like the spaces
field could be removed in favor of using SpacesAfter.
2019-11-20 15:03:58 +01:00
Folkert de Vries
af86b23ab5 Use the RecordField in conversion from assignedField 2019-11-20 15:03:58 +01:00
Folkert de Vries
b44e5e7d94 add RecordField pattern
this will allow pattern matches like

    case foo of
        { x : Just 4 } -> ...
        _ -> ...
2019-11-20 15:03:58 +01:00
Folkert de Vries
3d584a53b0 Use the RecordField in conversion from assignedField 2019-11-20 14:51:06 +01:00
Folkert de Vries
97e8600cdf add RecordField pattern
this will allow pattern matches like

    case foo of
        { x : Just 4 } -> ...
        _ -> ...
2019-11-20 14:51:06 +01: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
Folkert
d7e2555d08 extract AssignedField -> Pattern into function 2019-11-20 14:51:06 +01:00
Folkert
2af14921a7 add test for nested case 2019-11-20 14:44:32 +01:00
Folkert
53c7fdf52c Implement formatting for case expressions
I hope we can find some better abstractions for this, as it is quite
messy. But this seems to handle comments correctly so far.
2019-11-20 14:37:44 +01:00
Folkert de Vries
8ce7a8e6ed partial formatting of case & comments/newlines 2019-11-20 14:37:44 +01:00
Richard Feldman
2d79d7e7ca Remove obsolete gui/ directory 2019-11-20 07:34:25 -05:00
Richard Feldman
3e1355da3f
Merge pull request #12 from rtfeldman/nightly-release
Nightly release build
2019-11-20 07:33:48 -05:00
Richard Feldman
67a7108aac Lower type limit and update comment. 2019-11-20 07:20:00 -05:00
Richard Feldman
75c5dc0639 Fix --release syntax in GH Actions 2019-11-20 07:15:07 -05:00
Richard Feldman
4e3e6fee48 s/update cargo/cargo update 2019-11-20 07:14:43 -05:00
Richard Feldman
67c31fa50d Only do nightly build if tests pass 2019-11-20 07:12:15 -05:00
Richard Feldman
ba018d9283 Use --release on CI tests 2019-11-20 07:10:31 -05:00
Richard Feldman
793e951f3b Create either! macro 2019-11-20 07:10:31 -05:00
Richard Feldman
b074035df2 Use attempt! macro 2019-11-20 07:10:31 -05:00
Richard Feldman
1dafc614e7 Use macros for zero_or_more and one_or_more 2019-11-20 07:10:31 -05:00
Richard Feldman
cbbe80eeca Centralize the macro fallbacks 2019-11-20 07:10:31 -05:00
Richard Feldman
e850703ca9 Use and! over and() 2019-11-20 07:10:31 -05:00
Richard Feldman
76b815ab77 Use $crate in loc macro instead of outside imports 2019-11-20 07:10:31 -05:00
Richard Feldman
cc74c37045 Use loc! macro instead of loc() 2019-11-20 07:10:31 -05:00
Richard Feldman
155ae60348 Use BoxedParser for release builds so they finish.
Before this change, I tried leaving a release build running overnight
and killed it the next day after it had been running for 14 hours.
2019-11-20 07:10:31 -05:00
Richard Feldman
1b04830147 Make BoxedParser available to releases 2019-11-20 07:10:31 -05:00
Richard Feldman
7050547f9c Don't use BoxedParser for char or string 2019-11-20 07:10:31 -05:00
Richard Feldman
ecb495a4e2 Raise type_limit_length and explain 2019-11-20 07:10:31 -05:00
Richard Feldman
68c63a070a Add a nightly release build GH Action 2019-11-20 07:10:31 -05:00
Richard Feldman
722b60c679
Merge pull request #15 from rtfeldman/fix-inkwell-rev
Change inkwell rev to latest llvm-8.0
2019-11-20 07:08:00 -05:00
Richard Feldman
9e50b5cbc4 Change inkwell rev to latest llvm-8.0 2019-11-20 05:40:03 -05:00
Richard Feldman
7683d39113
Merge pull request #14 from rtfeldman/fix-case-gen
Fix case gen
2019-11-19 20:58:00 -05:00
Richard Feldman
1b03ec44bc Move some stuff into Env 2019-11-19 20:41:32 -05:00
Richard Feldman
a5054d15a0 Restore case code gen 2019-11-19 20:34:52 -05:00
Richard Feldman
9a29309ed0
Merge pull request #13 from rtfeldman/upgrade-inkwell
Upgrade inkwell
2019-11-19 18:37:20 -05:00
Richard Feldman
f3424c9017 Fix Inkwell compile errors 2019-11-19 18:34:18 -05:00
Richard Feldman
3217c7d013 Use a specific rev of Inkwell, not a branch
Turns out breaking API changes get pushed directly to that branch!
2019-11-19 07:47:53 -05:00
Folkert de Vries
d4f092d610
Merge pull request #10 from rtfeldman/desugar-if
Desugar if
2019-11-18 15:02:22 +01:00
Folkert de Vries
578a87fa70 update Cargo.lock 2019-11-18 14:56:58 +01:00