Commit graph

9048 commits

Author SHA1 Message Date
Richard Feldman
445c8528f1 Try cargo update again 2019-11-21 06:29:33 -05:00
Richard Feldman
24c9cc0d4d Try doing cargo clean in CI 2019-11-21 06:27:57 -05:00
Richard Feldman
2502702fd0 Partially restore a canonicalization test 2019-11-21 06:23:08 -05:00
Richard Feldman
4913ccd782
Merge pull request #20 from rtfeldman/fix-ci
Remove cargo update from CI
2019-11-21 06:02:17 -05:00
Folkert
38c7d96749 also analyze extracted procedures 2019-11-21 11:24:58 +01:00
Folkert
ead3351e34 implement reference count analysis for case 2019-11-21 10:26:36 +01:00
Folkert
e17cd7a1fb initial work on reference count analysis 2019-11-21 10:26:36 +01:00
Richard Feldman
f844e16361
Merge pull request #21 from rtfeldman/fix-canonicalization
Fix canonicalization bug
2019-11-20 19:58:31 -05:00
Richard Feldman
23de717257 Give an expression a name. 2019-11-20 19:57:35 -05:00
Richard Feldman
063ec1976b Fix canonicalization bug. 2019-11-20 19:57:12 -05:00
Richard Feldman
3d0d452b07 fixup! Reproduce canonicalization bug 2019-11-20 19:56:41 -05:00
Richard Feldman
121b255ae5 Fix canonicalization more 2019-11-20 19:42:33 -05:00
Richard Feldman
9c190e4a63 s/assignment/def 2019-11-20 19:39:45 -05:00
Richard Feldman
8fc91ad743 Partially fix canonicalization bug 2019-11-20 19:35:17 -05:00
Richard Feldman
f72021ee96 Reproduce canonicalization bug 2019-11-20 19:35:00 -05:00
Richard Feldman
b08c5bf464 Add more helpful panics 2019-11-20 19:34:36 -05:00
Richard Feldman
d70b07dbb9 Name the toolchain installation step 2019-11-20 18:24:40 -05:00
Richard Feldman
88052bc653 Give CI jobs more obvious names 2019-11-20 18:23:47 -05:00
Folkert de Vries
c848f8ba62
Merge pull request #17 from rtfeldman/format-case
Format case
2019-11-21 00:20:36 +01:00
Richard Feldman
e7a4ecad37 Try removing cargo update from CI 2019-11-20 18:19:38 -05:00
Richard Feldman
86d18c4470 Fix arithmetic regression 2019-11-20 18:16:52 -05:00
Richard Feldman
5504b52039 Use assert_formats_same 2019-11-20 18:14:33 -05:00
Richard Feldman
4fe9fed223 Use add_spaces and INDENT const 2019-11-20 18:08:20 -05:00
Richard Feldman
3bc974ab06 Merge branch 'trunk' into format-case 2019-11-20 18:00:07 -05:00
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