viniciusgerevini / clyde-js

Dialogue language and tools for games.
MIT License
62 stars 2 forks source link

Clyde Playground - Option, Line, Option Breaks Interpreter #31

Open GrownSamoyedDog opened 2 months ago

GrownSamoyedDog commented 2 months ago

This bug is only present on the online editor/interpreter Clyde Playground. In Godot, this bug is not present making it less bad, but the discrepancy between the two confused me for a while.

If you have: Option->Line->Option then the program softlocks.

An example is provided here:

-- This works - No Softlock!

Knock Knock!
    + Who's There?
I am!

-- This doesn't work - Softlock!
-- (In Clyde Playground)

Knock Knock!
    + Who's There?
Lettuce
    + Lettuce Who?
Lettuce in, it's getting cold!

I assume this has something to do with the way it is being Tokenized or Parsed. Because Options are fused together with its previous Line, it is probably interpreted as: Option->Option

This has likely gone unnoticed because using += or *= instead will mask the problem by adding an extra line.

viniciusgerevini commented 2 months ago

Thank you! Thanks for the example. I have the feeling I've seen this before but haven't been able to reproduce it. Cheers.