koka-lang / koka

Koka language compiler and interpreter
http://koka-lang.org
Other
3.16k stars 151 forks source link

Spec grammar is out of sync #362

Open mingodad opened 9 months ago

mingodad commented 9 months ago

Adding the grammar in https://github.com/koka-lang/koka/blob/master/doc/spec/grammar/parser.y to https://mingodad.github.io/parsertl-playground/playground/ (a Yacc/Lex editor/tester) and trying the samples in samples/* I've noticed that they fail due to the grammar been out of sync.

TimWhiting commented 9 months ago

It looks like you might be missing the layout algorithm that should be run between lexing and parsing. It should insert a bunch of artificial braces based on indentation level.

mingodad commented 9 months ago

Thank you for pointing it out ! I've update the parser and example with a note explaining that it doesn't automatically add {, } and ;.