mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 11:52:19 +00:00

Instead of parsing dbg with an expression block, parse the dbg keyword with no additional arguments. This way the parser treats dbg just like a variable in function application. We desugar by pattern matching on `Apply(Dbg, args, called_via)` nodes. This changes the output of syntax tests since the initial AST is different, but does not change the output of can or mono. Add two new errors for dbg in expression position with either no args or too many args. This is similar to the error behavior of `crash`. Continue to parse dbg statements with an expression block, as before.
14 lines
174 B
Text
14 lines
174 B
Text
SpaceAfter(
|
|
Apply(
|
|
@0-5 Dbg,
|
|
[
|
|
@4-5 Num(
|
|
"1",
|
|
),
|
|
],
|
|
Space,
|
|
),
|
|
[
|
|
Newline,
|
|
],
|
|
)
|