Commit graph

49 commits

Author SHA1 Message Date
Richard Feldman
bee24fcd37
Add parse tests for package header 2022-12-04 06:26:44 -05:00
Joshua Warner
2b91af02df
Introduce record! combinator
... and refactor header parser to fully use combinators, in support of future combinator-based superpowers
2022-11-28 20:25:55 -08:00
Folkert
c9ba57f15a
fix merge conflict that made it to main 2022-11-29 00:20:03 +01:00
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
f9de522004
Add crash fmt test 2022-11-24 14:46:54 -06: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
adddc1ff70
Fix dbg parse test 2022-11-24 03:31:19 -05: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
8d79182730
Actually parse to Expr::Tuple... whoops! 2022-11-11 14:21:08 -05:00
Joshua Warner
1753c9cf5b
Implement initial tuple syntax 2022-11-08 18:04:46 -05:00
Joshua Warner
5d5b71a083
Refactor several parse methods to use more combinators 2022-11-05 09:44:08 -04:00
Joshua Warner
060a69aed2
Fix CI 2022-11-04 09:47:55 -04: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
231a72f2ee
Insert first ability correctly in the parser 2022-10-24 13:56:07 -05:00
Ayaz Hafiz
97dbac1631
Add tests for multiple abilities bound to a variable 2022-10-24 13:56:07 -05:00
Ayaz Hafiz
548a235c25
Support parsing multiple abilities in a clause 2022-10-24 13:56:06 -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
Ayaz Hafiz
d88452e3d2
Update parse tests 2022-09-20 14:45:52 -05:00
kilianv
610c529ba8
Update roc files to use new opaque bools 2022-09-20 14:42:04 -05: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
Joshua Warner
92a9570384 Remove indents from multiline strings 2022-07-25 06:52:08 -07: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
31455f5fbd Remove first newline and indent from string 2022-07-20 19:20:48 -07: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
Richard Feldman
f575807834
Merge remote-tracking branch 'origin/trunk' into outdent-infix 2022-07-16 16:08:36 -04:00
Ayaz Hafiz
4d54e2ee3c
Add test for empty impl block parse 2022-07-15 11:15:44 -04:00
Ayaz Hafiz
ecaccdaac3
Update parse tests 2022-07-15 11:15:01 -04:00
Ayaz Hafiz
85599e3a9a
Parse impl blocks in abilities 2022-07-15 11:06:44 -04:00
Ayaz Hafiz
d4d073d8c6
Rename Derived to HasAbility 2022-07-14 10:38:37 -04:00
Richard Feldman
2013e308f7
Update parser tests 2022-07-13 22:02:56 -04:00
Anton-4
eee85fa45d
moved all crates into seperate folder + related path fixes 2022-07-01 17:37:43 +02:00