-
This is probably easy for somebody savvy, but I'm stuck. Freely admit that this is completely new to me, so I appreciate any help provided (even if it's "go read this"). I'm just trying to create a terminal for a comment string that begins with '$' followed by at least one space using the HelloWorld example grammar.
I've tested the regex 100x times and it seems to work: hello-world.langium: grammar HelloWorld
entry Model:
(persons+=Person | greetings+=Greeting)*;
Person:
'person' name=ID;
Greeting:
'Hello' person=[Person:ID] '!';
hidden terminal WS: /\s+/;
terminal ID: /[_a-zA-Z][\w_]*/;
terminal INT returns number: /[0-9]+/;
terminal STRING: /"[^"]*"|'[^']*'/;
hidden terminal SL_COMMENT: /\$ [^\n\r]*/;
// hidden terminal ML_COMMENT: /\/\*[\s\S]*?\*\//;
// hidden terminal SL_COMMENT: /\/\/[^\n\r]*/; test.hello: person Bob
Hello Bob!
person Alice
Hello Alice!
$ failed comment Lint and Errors:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Hi @snarkipus, I can't seem to reproduce this issue. The terminal parses successfully for me (I modified our arithmetrics example for it): Did you rerun the |
Beta Was this translation helpful? Give feedback.
Hi @snarkipus,
I can't seem to reproduce this issue. The terminal parses successfully for me (I modified our arithmetrics example for it):
Did you rerun the
langium generate
command after modifying the grammar?