Commit graph

143 commits

Author SHA1 Message Date
Anthony Bullard
a2083cec30
Parsing support for snake_case identifiers
In this initial commit, I have done the following:

- Added unit tests to roc_parse's ident.rs file to cover at least the
  simplest Ident enum cases (Tag, OpaqueRef, and simple Access)
- Added '_' as a valid "rest" character in both uppercase and lowercase
  identifier parts
- Updated the test_syntax snapshots appropriately

There is still a lot left to do here. Such as:

- Do we want to allow multiple '_'s to parse successfully?
- Handle qualified access
- Handle accessor functions
- Handle record update functions
- Remove the UnderscoreInMiddle case from BadIdent
- Write unit tests for Malformed Idents

I am not a "Rustacean" by any means, but have been through the Book in
years past.  Any feedback on the way I wrote the tests or any other part
of the implementation would be very appreciated.
2024-12-03 20:50:47 -06:00
Sam Mohr
0a82f313c3
Merge branch 'main' into allow-try-in-statements 2024-12-01 23:02:41 -05:00
Sam Mohr
febe95c228
Generalize return vars 2024-12-01 02:24:51 -08:00
Sam Mohr
29c8759bc0
Merge branch 'main' into allow-try-in-statements 2024-12-01 00:35:18 -08:00
Agus Zubiaga
6ffc8a507b
Allow suffixed pure functions that are exposed to the host 2024-11-27 14:06:37 -03:00
Agus Zubiaga
0a98580277
Use "opaques" instead of "opaque types" in reporting 2024-11-25 19:32:08 -03:00
Agus Zubiaga
2e96aca0fd
Merge branch 'main' into specialize-exprs 2024-11-23 01:48:51 -03:00
Sam Mohr
d8b73f25e6
Merge branch 'main' into allow-try-in-statements
Signed-off-by: Sam Mohr <sam@sammohr.dev>
2024-11-21 21:03:27 -08:00
Sam Mohr
d449d83a84
Allow pure statements that contain early returns 2024-11-21 12:22:01 -08:00
Sam Mohr
899a7d3308
Add reporting tests for annotated functions with early returns 2024-11-21 04:38:58 -08:00
Luke Boswell
4b4ab7bc0c
Merge remote-tracking branch 'remote/main' into record-suffix-warn-tweaks 2024-11-13 07:29:31 +11:00
Luke Boswell
9465b29376
fix test reporting 2024-11-11 19:47:55 +11:00
Luke Boswell
fc0f938e5c
fix test_reporting 2024-11-11 14:07:52 +11:00
Luke Boswell
8a566dc339
WIP 2024-11-11 10:22:58 +11:00
Agus Zubiaga
ecc5fa57dd
Check record field suffixes in annotations 2024-11-09 02:06:05 -03:00
Agus Zubiaga
12c735644f
Do not warn about pure functions in suffixed record literal fields
Records fields that allow effectful functions, should also accept
pure functions.
2024-11-09 01:05:06 -03:00
Agus Zubiaga
bc0cfef128
Restore UNNCESSARY DEFINITION errors for top-level defs
Non-top-level defs are already covered
2024-11-07 18:54:25 -03:00
Agus Zubiaga
a4296ca19d
Improve wording in pattern suffix errors 2024-11-07 18:54:25 -03:00
Agus Zubiaga
1e835bbb17
Fix 'right-hand side' typo in errors 2024-11-07 18:54:25 -03:00
Agus Zubiaga
935d460236
Use plural 'effects' in FxInTopLevel error 2024-11-07 18:54:25 -03:00
Agus Zubiaga
c9f001b041
Allow ignored defs with an effectful RHS 2024-11-07 18:54:22 -03:00
Agus Zubiaga
175a2b5683
Add hint about forgetting to call a function 2024-11-07 18:54:21 -03:00
Agus Zubiaga
af6fc6306f
Treat untyped unsuffixed functions as pure 2024-11-07 18:54:21 -03:00
Agus Zubiaga
70fa4d036c
Test opaque destructure suffixes 2024-11-07 18:54:21 -03:00
Agus Zubiaga
a0783c3132
Test tag destructure suffixes 2024-11-07 18:54:21 -03:00
Agus Zubiaga
2c208f9389
Test tuple destructure suffixes 2024-11-07 18:54:20 -03:00
Agus Zubiaga
e75b1cf7a0
Check suffixes of all pattern identifiers 2024-11-07 18:54:20 -03:00
Agus Zubiaga
a31a35100b
Report suffixed pure function in literal record field 2024-11-07 18:54:20 -03:00
Agus Zubiaga
215de707fa
Report unsuffixed record literal field with effectful function 2024-11-07 18:54:20 -03:00
Agus Zubiaga
ea35094b28
Remove flex var case when checking symbol suffix 2024-11-07 18:54:20 -03:00
Agus Zubiaga
89a918cebe
Fix unifying pure with flex vars 2024-11-07 18:54:19 -03:00
Agus Zubiaga
6533e9084d
Add fx to ErrorType 2024-11-07 18:54:19 -03:00
Agus Zubiaga
6adc6d9168
Report ignored statement results 2024-11-07 18:54:18 -03:00
Agus Zubiaga
b01771c5ae
Show effectful function name in mismatches 2024-11-07 18:54:18 -03:00
Agus Zubiaga
f666dba67d
Report effectful top-level exprs 2024-11-07 18:54:17 -03:00
Agus Zubiaga
b62665e49e
Report effectful statement in pure function 2024-11-07 18:54:17 -03:00
Agus Zubiaga
fd2493ee51
Report effect call in pure function 2024-11-07 18:54:17 -03:00
Agus Zubiaga
839078b5d1
Test aliased unsuffixed effectful function 2024-11-07 18:54:17 -03:00
Agus Zubiaga
d22b2a79f5
Suffixed pure function warning 2024-11-07 18:54:17 -03:00
Agus Zubiaga
1da8af390b
Unsuffixed effectul function warning 2024-11-07 18:54:16 -03:00
Agus Zubiaga
69e026f8bb
Leftover statement warning for pure statements 2024-11-07 18:54:16 -03:00
Agus Zubiaga
2cce5ad023
Allow unsuffixed statements in parser
Moves the "STATEMENT AFTER EXPRESSION" error from the parser to canonicalization.
We'll later use this to allow this case in effectful functions.
2024-11-07 18:54:14 -03:00
Agus Zubiaga
160dbee943
Nicer message for unhandled expr errors 2024-11-06 12:15:38 -03:00
Agus Zubiaga
f4c8492c1c
Report return syntax errors 2024-11-06 10:50:32 -03:00
Luke Boswell
c00db6da37
Merge remote-tracking branch 'remote/main' into rebuild-platform 2024-11-04 13:57:51 +11:00
Sam Mohr
66cc96edbb
Address PR comments from @ayazhafiz 2024-10-29 15:58:35 -07:00
Sam Mohr
a9cd6ac5fa
Fix tailcalling 2024-10-26 06:48:01 -07:00
Luke Boswell
926014518f
Merge remote-tracking branch 'remote/main' into rebuild-platform 2024-10-24 10:21:08 +11:00
JRI98
511308d4d3
Fix #6240 2024-10-22 12:04:48 +01:00
Luke Boswell
e3afeaa7ff
WIP Merge remote-tracking branch 'remote/main' into rebuild-platform 2024-10-09 09:21:46 +11:00