New Indentation functionality not working correctly #1610
Replies: 3 comments 2 replies
-
Hey @mnaderhirn, the lexer is working correctly, and the test you're using via The parser error you're seeing is due to a grammar issue. Your grammar doesn't actually allow to parse more grammar IndentGrammar
entry IntendTest:
'{{{' NEWLINE
test=Indent_part?
'}}}';
Indent_part:
INDENT
(test+='text' NEWLINE | Indent_part)* // <-- Allows to parse more `text` tokens after leaving the `Indent_part` rule
DEDENT;
terminal NEWLINE: /[\r?\n]+/;
terminal DEDENT: 'synthetic:indent';
terminal INDENT: 'synthetic:dedent';
hidden terminal WS: /[ \t]+/; |
Beta Was this translation helpful? Give feedback.
-
Should one expect these examples to work in the Langium Playground? They don't appear to be working in the current playground as of 8/19/2024 |
Beta Was this translation helpful? Give feedback.
-
These examples use this style of terminal declaration: terminal INDENT: 'synthetic:indent'; Whereas the code comments indicate this style in the indentation-aware.ts src/ file: terminal INDENT: ':synthetic-indent:'; Is there a material difference? The playground chokes on the first syntax and at least doesn't lock up loading... on the second syntax |
Beta Was this translation helpful? Give feedback.
-
I am trying out the new identation-aware function.
this is my grammar:
when i enter this:
I get the following errors:
This are the tokens i get
shouldn't there be an 'DEDENT' after the '\n' after the send 'text' token?
Beta Was this translation helpful? Give feedback.
All reactions