Commit graph

29 commits

Author SHA1 Message Date
Joshua Warner
a3071a8aea
Allow migrating reporting tests to failing parse tests 2022-11-26 17:34:50 -08:00
Richard Feldman
58fad36f9d
Merge pull request #4460 from roc-lang/crash
Crash
2022-11-25 17:18:21 -05:00
Joshua Warner
56470c838d
Implement tuple accessors after records/tuples 2022-11-24 15:32:39 -08:00
Ayaz Hafiz
fee01166c7
Add crash as a keyword 2022-11-24 14:46:49 -06:00
Ayaz
848c18f996
Merge pull request #4567 from joshuawarner32/tuple-type-annotation
Implement tuple type parsing
2022-11-24 14:42:11 -06:00
Joshua Warner
c6b5273144
Implement tuple type parsing
Also change some tests with newly relaxed indentation requirements, and remove an irrelevant test (since unindented close parens are now perfectly valid, the test is no longer useful).
2022-11-24 07:36:59 -08:00
Richard Feldman
73a591743b
Add parser tests for dbg 2022-11-22 21:27:10 -05:00
Joshua Warner
2d9aba2242
Refactor parser methods to not return State as part of ParseError
As previously discovered with #4464, it's easy to accidentally mis-use the State value returned on the Err path.

There were mixed assumptions about what that State represents: (1) the State where the error occurred, or (2) the State at the beginning of the thing we were just parsing.

I fixed this up to always mean (2) - at which point we don't actually need to return the State at all - so it's impossible for further discrepency to creep in.

I also took the liberty to refactor a few more methods to be purely combinator-based, rather than calling `parse` directly.
2022-11-18 19:52:23 -05:00
Joshua Warner
36f0e9d4f5
Add test for multiline tuple with comments 2022-11-15 19:51:02 -05:00
Joshua Warner
d4bf946327
Assert formatting for parse tests 2022-11-15 19:47:28 -05:00
Joshua Warner
ca5d084497
Implement tuple pattern parsing
Step 2 of N in implementing #4465
2022-11-13 16:11:57 -05:00
Joshua Warner
f4ce4bf983
Implement parsing for tuple accessor functions (.1, .2, etc)
Step 2 of N toward implementing #4465
2022-11-12 09:56:29 -05:00
Joshua Warner
1753c9cf5b
Implement initial tuple syntax 2022-11-08 18:04:46 -05:00
Joshua Warner
b2bb38220b
Make parse tests for reporting tests 2022-11-03 17:24:02 -04:00
Joshua Warner
07be8ec000
Refactor Parser trait to pass min_indent
This removes the need to explicitly pass thru min_indent when using the parser combinators.

My ultimate goal here is to evolve the current parser closer toward a purely combinator-based parser,
at which point we can more easily transition smoothly to a formal(ish) grammar, or expand the meanings of combinators
to include things like:
* Incremental (re)parsing
* Unified parsing and formatting code
* Better error recovery
* Using the main parser directly for syntax highlighting
2022-10-31 13:31:47 -07:00
Ayaz Hafiz
4d35ab9957
Parse list patterns 2022-10-26 17:03:22 -05:00
Ayaz Hafiz
97dbac1631
Add tests for multiple abilities bound to a variable 2022-10-24 13:56:07 -05:00
Joshua Warner
e39a385f5f
Allow parsing when cases with python-like indentation 2022-10-18 19:13:20 -07:00
Joshua Warner
4d4c0d9483 Don't allow closures to gobble unindented expr lines following them 2022-10-08 11:05:05 -07:00
Richard Feldman
97e2900bf5
s/rtfeldman/roc-lang/g in links to GitHub repos 2022-08-12 15:24:09 -04:00
Folkert
9a352440de
parse expect-fx 2022-08-09 14:19:12 +02:00
Richard Feldman
fa5bd442f8
Merge pull request #3635 from rtfeldman/joshuawarner32/multiline
Strip indents and the first/last newline from multiline strings
2022-07-26 22:09:58 -04:00
Folkert de Vries
50021a65cf
Merge pull request #3615 from rtfeldman/3198
Support parsing opaque destructures as first item in nested body
2022-07-25 19:32:57 +02:00
Richard Feldman
bbf867c1d1
Reproduce missing support for when after operator 2022-07-24 18:25:02 -04:00
Ayaz Hafiz
fbd70c4031
Parse assignment patterns with underscores 2022-07-24 16:10:01 -04:00
Ayaz Hafiz
b04764bdd6
Support parsing opaque destructures as first item in nested body
Closes #3198
2022-07-22 16:35:02 -04:00
Joshua Warner
61b1ab059a Add test for removing indents in multiline strings 2022-07-20 19:20:10 -07:00
Joshua Warner
ada8af25cc Correct indentation for when expressions
... and simultaneously remove the need for State::indent_column field / multiline tracking in blankspace.rs.

Fixes #2889
2022-07-17 19:26:33 -07:00
Anton-4
eee85fa45d
moved all crates into seperate folder + related path fixes 2022-07-01 17:37:43 +02:00
Renamed from compiler/parse/tests/test_parse.rs (Browse further)