Nivekk / KOS

Fully programmable autopilot mod for KSP.
Other
80 stars 30 forks source link

(v0.92) Parsing the quoted literal out of order. Causing flagrant error again (in "set" command this time). #198

Closed Dunbaratu closed 10 years ago

Dunbaratu commented 10 years ago

This seems very similar to the bug that used to exist with the LOG command in issue #116.

set str to "go to jail." .

Causes a "Flagrant error" now in 0.92 because of the word "to" appearing inside the string. It seems to be parsing this as: set str to "go to jail." instead of: set str to "go to jail." If I change it to this statement:

set str to "go t" + "o jail.".

to break up the word "to", then it runs.

Dunbaratu commented 10 years ago

The place where I encountered this is in trying to do a bit of self-modifying code:

set cmd to "switch to 1.". // flagrant error here.
log cmd to tmpCmd.
run tmpCmd.
Nivekk commented 10 years ago

I pushed a fix that upgrades the ~ kegex character to not allow quotes, then used that on the set statement.