picoe / Eto.Parse

Recursive descent LL(k) parser for .NET with Fluent API, BNF, EBNF and Gold Grammars
MIT License
148 stars 30 forks source link

Support for INDENT and DEDENT #25

Open LaylBongers opened 9 years ago

LaylBongers commented 9 years ago

Having optional support for INDENT/DEDENT tokens would make parsing languages that require whitespace to define blocks easier.

Example:

do_thing param1, param2
if thing
    do_even_more "Hello"
    another_call "World"
and_finally "!"

Here an INDENT token would be placed right before do_event_more, but not before another_call as they're in the same indentation level. A DEDENT would be placed right before and_finally.

More information on how this is handled by the python parser can be found here: http://www.secnetix.de/olli/Python/block_indentation.hawk