Commit graph

58 commits

Author SHA1 Message Date
Agus Zubiaga
755e16cb10
Report exposing list end error in imports 2024-05-06 23:38:12 -03:00
Agus Zubiaga
dc18597a0e
Report unfinished exposing in imports 2024-05-06 23:24:56 -03:00
Agus Zubiaga
f81985533c
Report import lowercase alias 2024-05-06 23:16:18 -03:00
Agus Zubiaga
97ed8fdbbd
Report unfinished import as 2024-05-06 23:03:40 -03:00
Agus Zubiaga
bfb77b78cb
Report import ending syntax error 2024-05-06 22:22:00 -03:00
Agus Zubiaga
007e03891e
Report module name / path syntax error in imports 2024-05-06 21:00:17 -03:00
Agus Zubiaga
233310cabf
Report space problem in import 2024-05-06 20:26:07 -03:00
Agus Zubiaga
520dc389f3
Report ingested file annotation syntax error 2024-05-05 17:45:37 -03:00
Agus Zubiaga
057a18573a
New module header
Implements the new `module` header syntax as described in "module and package changes" [1]:

```
module [Request, Response, req]
```

The old syntax should still work fine, and is automatically upgraded to the new one
when running `roc format`.

[1] https://docs.google.com/document/d/1E_77fO-44BtoBtXoVeWyGh1xN2KRTWTu8q6i25RNNx0/edit
2024-05-01 10:39:12 -03:00
Luke Boswell
ca01913ab3
add EExpr error for unexpected comma 2024-04-02 20:48:13 +11:00
Richard Feldman
878042bc3d
Revise error for single-quote interpolation 2024-02-27 12:11:54 -05:00
Richard Feldman
ffd72b184b
Fix tests 2024-02-27 11:35:06 -05:00
Richard Feldman
6f84e24fa5
Merge remote-tracking branch 'origin/main' into more-dollars 2024-02-26 23:06:23 -05:00
Anton-4
f47b2eb2eb
change wording
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2024-02-03 12:05:15 +01:00
Asher Mancinelli
da261be209
[parse] Better error message for bad packages list
When an appropriate list end is not found in the packages list, give a
more informative error message.
2024-01-27 11:25:19 -08:00
Richard Feldman
8ea38d3a04
Parse deprecated interpolation syntax differently 2024-01-06 18:26:27 -05:00
Richard Feldman
7189104df8
Update roc code base to use $(...) syntax 2024-01-06 18:03:00 -05:00
Luke Boswell
f837870a63
handle TrailingOperator error 2023-12-09 19:42:09 +11:00
Anton-4
ba1a1e9243
minor wording change
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2023-11-28 11:42:52 +01:00
caryoscelus
2fc8e88cca
Report lacking platform name in app header 2023-11-28 05:52:43 +00:00
caryoscelus
d141237a17
Report lacking to while parsing app header 2023-11-28 02:18:24 +00:00
jecaro
57f55dbe7e
Fix typo 2023-11-21 19:47:27 +01:00
jecaro
0781232940
Set a better error msg for non uft8 encoded files 2023-11-14 15:22:22 +01:00
Anton-4
f0795e6935
minor improvements 2023-09-15 19:51:13 +02:00
Fabian Schmalzried
3e41f6eb5a
implement error message for HasMisplacedCarriageReturn
Also had to filter out the escape characters
so the erroe message does not get messed up
2023-09-10 17:17:26 +02:00
Fabian Schmalzried
49a1a3b46d
Implement error message for ASCII control characters 2023-09-10 15:58:36 +02:00
Anton-4
6eb5362383
minor error improvement
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2023-08-02 17:01:57 +02:00
Artsiom Shamsutdzinau
a806ea1a5b
improve error message for <| operator non-existence 2023-07-07 17:44:39 +02:00
Kilian Vounckx
bf2c01554f
Give better error messages when provides is missing in header 2023-06-27 20:12:02 +02:00
Agustin Zubiaga
f94004d137 Parse builders without backtracking from records 2023-05-13 20:05:42 -03:00
Joshua Warner
94070e8ba6
Improve parsing of scalar literals
* Unify parsing of string literals and scalar literals, to (e.g.) ensure escapes are handled uniformly. Notably, this makes unicode escapes valid in scalar literals.
* Add a variety of custom error messages about specific failure cases of parsing string/scalar literals. For example, if we're expecting a string (e.g. a package name in the header) and the user tried using single quotes, give a clear message about that.
* Fix formatting of unicode escapes (they previously used {}, now correctly use () to match roc strings)
2023-01-07 15:12:52 -08:00
Joshua Warner
0da50a612d
Be more lenient with required indentation in collections
... and also remove a bunch of now-dead errors that can't be triggered.
2023-01-01 17:49:51 -08:00
Folkert
439befcc38
run cargo fmt 2022-12-23 17:19:54 +01:00
Lunarmagpie
f932bb66a0
Add function binding to error message 2022-12-23 11:07:57 -05:00
Lunarmagpie
3265a786a5
make changes suggested by folkertdev 2022-12-23 11:01:50 -05:00
Richard Feldman
e84b3c2704
Merge pull request #4781 from roc-lang/dbg-final-expression
parse error for dbg/expect final expressions
2022-12-19 23:36:51 -05:00
Folkert
d97fd98a33
parse error for dbg/expect final expressions 2022-12-16 22:47:53 +01:00
Richard Feldman
da595a86b0
Parse package module header 2022-12-04 06:26:44 -05:00
Ayaz Hafiz
e438fbf37c
Enumerate severity on problem variants 2022-12-02 14:11:57 -06:00
Joshua Warner
451b2c0ded
Refactor collections 2022-11-26 09:55:54 -08: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
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
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
bc2ec738a0
Merge pull request #4281 from lucacervello/suggest-lambda-operator
Add suggest lambda operator instead of when
2022-10-31 10:29:46 -07:00
Ayaz Hafiz
89867a4dc5
Add parsing error reporting for list patterns 2022-10-26 18:05:52 -05:00
Luca Cervello
b39f0d98b7
review: use parser suggestion 2022-10-17 18:43:28 +02:00
Christopher Duncan
d7cdcfc66b
Fix typo in error 2022-10-12 08:26:33 -04:00
Luca Cervello
1c0b1ba0af
feat: suggest lambda operator 2022-10-10 12:43:38 +02:00