Nivekk / KOS

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

(v0.92) Unterminated literal strings causing KSP to freeze again.. #199

Closed Dunbaratu closed 10 years ago

Dunbaratu commented 10 years ago

Something about the new way expressions are dealt with seems to have made an old bug re-appear:

Make the following one-line program file:

print "hello .

(Note the lack of a terminating quote mark for the string.)

Then run the program. KSP freezes and requires an external kill (from the task manager if it's Windows for example).

Note, it does not happen if you just type it at the interactive prompt. It only does this when it's inside a program file.

In reading a program file, if it hits EOF and still hasn't found the closing quote, it freezes KSP as described.

In reading interactively, there's no such thing as EOF and so it just keeps trying to look for that closing quote mark on each line you type and keeps the string "open" indefinitely until you eventually type one. This behavior is fine and makes perfect sense to me. But the case of hitting EOF in a program needs to be dealt with more gracefully with a syntax error message instead of freezing KSP.