Commit graph

200 commits

Author SHA1 Message Date
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
Folkert
e44a8a9eed
print all the relevant info 2022-11-23 22:58:58 +01:00
Richard Feldman
49f8768271
Parse and format dbg 2022-11-22 21:08:26 -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
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
Richard Feldman
c03dc17ab4
Merge remote-tracking branch 'origin/main' into repl 2022-11-05 01:04:44 -04:00
Richard Feldman
c4baf32e51
Merge pull request #4463 from roc-lang/clippy-1.65
clippy 1.65
2022-11-03 20:10:53 -07:00
Joshua Warner
311193fe70
Fix one_of error state handling 2022-11-03 20:54:08 -04:00
Folkert
66a1ba00eb
1.65 clippy fixes 2022-11-03 16:20:37 +01:00
Richard Feldman
220c362671
Merge remote-tracking branch 'origin/main' into repl 2022-10-31 20:49:28 -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
Richard Feldman
0c8f6a0a72
Fix annotated defs in repl 2022-10-30 13:34:38 -04:00
Richard Feldman
e38ae00c65
Expose macros for joining up AnnotatedBody nodes 2022-10-30 12:36:10 -04:00
Richard Feldman
99f4d99771
Revert "Attempt a refactor, but run into lifetime issues"
This reverts commit 4a9b44aaaf.
2022-10-30 07:22:32 -04:00
Richard Feldman
4a9b44aaaf
Attempt a refactor, but run into lifetime issues 2022-10-30 07:22:31 -04:00
Richard Feldman
9f498add60
Reorganize some REPL modules 2022-10-27 18:47:27 -04:00
Richard Feldman
40498d71c3
clip clap clorp 2022-10-26 16:11:30 -04:00
Richard Feldman
c748d88c0d
Fix typo in docs 2022-10-26 13:44:13 -04:00
Richard Feldman
785e0d5ef6
Revise things to be more concise 2022-10-26 13:44:13 -04:00
Richard Feldman
9b19ed8b3b
Refactor out Next 2022-10-26 13:44:12 -04:00
Richard Feldman
a1104ce5fa
Refactor out Next::Fixup 2022-10-26 13:44:12 -04:00
Richard Feldman
107f37219f
Document Fixup 2022-10-26 13:44:12 -04:00
Richard Feldman
131c4b2bb1
Extract parse_single_def 2022-10-26 13:44:12 -04: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
Joshua Warner
ab4e03b05d Rename Lambda -> Closure for consistency 2022-10-08 11:05:05 -07:00
Ayaz Hafiz
f6c21cc933
Correctly format abilities with comments 2022-10-04 10:03:51 -05:00
Folkert
3aa4ebb02f
get expect-fx to actually run 2022-08-12 23:03:01 +02:00
Folkert
9a352440de
parse expect-fx 2022-08-09 14:19:12 +02: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
a1a3eff278
Support when after binop 2022-07-24 18:25:02 -04:00
Richard Feldman
0d2141d8b8
Separate out parse_loc_term_or_underscore_or_if 2022-07-24 18:15:18 -04:00
Ayaz Hafiz
fbd70c4031
Parse assignment patterns with underscores 2022-07-24 16:10:01 -04:00
Ayaz Hafiz
8f7bae3617
Simplify boolean expr 2022-07-22 18:21:34 -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
Folkert
2caf58dfd2
show preceding comment in test panic messages 2022-07-21 10:42:58 -04:00
Folkert
7597d11b59
parse the region of the preceding comment for an expect 2022-07-21 10:42:57 -04:00
Richard Feldman
73cd5b8c7c
Parse ability definitions using record exprs, not types 2022-07-18 17:55:00 -04: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
d4d073d8c6
Rename Derived to HasAbility 2022-07-14 10:38:37 -04:00
Ayaz Hafiz
0946a7816a
Rename has_derived to has_abilities 2022-07-14 09:58:18 -04:00
Richard Feldman
d67d118e61
Don't require indenting alternative when patterns 2022-07-13 22:02:38 -04:00
Folkert
3dee90ced8
remove parse::ast::Def 2022-07-10 01:10:37 +02: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/src/expr.rs (Browse further)