kitty-lang icon indicating copy to clipboard operation
kitty-lang copied to clipboard

Sequence of more than 2 expressions doesn't parse

Open Vertmo opened this issue 6 years ago • 1 comments

Probably due to an (undetected ?) shift / reduce conflict in the parser, sequence of expressions are only valid for 2 expressions. You can reproduce the issue with the following kitty-lang sample :

1; 2; 3

This will raise a ParseError

Vertmo avatar Oct 01 '18 09:10 Vertmo

Somewhat linked to this https://github.com/darnuria/kitty-lang/blob/master/parser.mly#L129. I am not satisfied by how statements are ~~not~~ handled now.

I have some idea to address this nicely like introducing a effect system block imperative where you can do local mutation and statement. But I didn't dig the problem too much.

Before any step, I prefer to add a Harley Mindler like type system and after add statement and mutation after.

darnuria avatar Oct 09 '18 14:10 darnuria