Nivekk / KOS

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

New parenthesis match check treats valid code as syntax errors. #101

Open Dunbaratu opened 10 years ago

Dunbaratu commented 10 years ago

Look at the following example code:

print "This is some long text I am typing ( and it has ".
print "some parenthesized expression in it as a test ".
print "example of the problem)".

It should compile and run just fine. It does not anymore in 0.7. It now gives this error message:

Error on line 0: Bracket matching error.

One of my programs broke with the change and I traced it down to this problem. It seems to be unable to realize that parentheses inside literal quotes are not part of what the matching checker should be checking for.

xZise commented 10 years ago

The pull request #87 should address that: It (should) ignore all brackets within quotes.

Nivekk commented 10 years ago

I found some problems with that pull request, this would freeze kOS: PRINT ("".

I implemented a recursive "Balance" function that seems to work well in my tests