-
The usual grammar formats (bnf, antlr) seem to not be able to express block-opening-and-closing via indent and dedent, without having to rely on custom hand-coded lexers emitting dedent/indent tokens. In other words: not purely expressible in (and generatable from) just the grammar file. Since lark is done in Python, does it have a smoother, ie. grammar-only, story for formulating significant-newline/indent/dedent-based syntaxes such as CoffeeScript, GDScript or indeed Python? (Ignoring only-seemingly-line-based languages here that bring their own dedicated |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
No, lark doesn't have a pure grammar way of expressing this, but it does have a very smooth way of having indentation based languages, see the python grammar example. |
Beta Was this translation helpful? Give feedback.
No, lark doesn't have a pure grammar way of expressing this, but it does have a very smooth way of having indentation based languages, see the python grammar example.