dbaumgarten / yodk

Development Kit for Starbase's ingame programming language YOLOL
MIT License
57 stars 16 forks source link

VSCode shows error when its not #106

Open Archaegeo opened 3 years ago

Archaegeo commented 3 years ago

VSCode interface shows this as erroneous code but it works fine in game endendgotoe (thats end end goto e)

Also shows andn in (n>0andn<=a) as error but it works fine.

(BTW, thanks for the awesome tool)

Archaegeo commented 3 years ago

Follow up, this level of compression runs in game ifothenw=:w1 ifsthen:w1=tendelsew=:w2 ifsthen:w2=tendendgotoe

dbaumgarten commented 3 years ago

The first example seems to be a duplicate of #84 . Statements on one line should usually be seperated by spaces, except when not. This could theoretically be "fixed", but it would be such a dirty hack, that I am not sure if I really want to fix it.

Are you really sure about the second one? I tested the whole space-requirement thing pretty thoroughly and came to the conclusion that "and" and "or" need to be surrounded by non-identifier characters (spaces, parenthesis etc.).

Your third snippet looks really horrible. I had to read it like 5 times to understand what is going on... The issue here are things like "othen". The tokenizer has no chance to decide if this is a variable, or actually "o then". To do this it would need context-sensitive parsing, like the game does it. But something I really don't want to do. Thats just evil and pure madness.

Archaegeo commented 3 years ago

This is live code running that works, shrug, just providing the feedback. https://github.com/Archaegeo/Starbase/blob/main/ISAN-Waypoint%20System/30WPIncrement.yolol