-
-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
I'm unsure if this is expected, but comments in mel.raw expressions can cause parse errors at runtime. Code like the following:
[%mel.raw {|
// before
const a = 1;
// after
|}];
Generates the js:
((// before
const a = 1;
// after));
And a parse error like the following:
Unexpected token (27:0)
25 |
26 | ((// before
> 27 | const a = 1;
| ^
28 | // after
29 | const b = 1;));
This works fine with [%%mel.raw ...]
, since I assume it allows statements. Could this be caught earlier in the pipeline to avoid invalid generated code, or is this expected? If so, feel free to close and maybe this will help someone in the future who might be confused about the single and double percent sign for ocaml directives.
Metadata
Metadata
Assignees
Labels
No labels