Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sclang: fix string/symbol lexing #4255

Merged
merged 1 commit into from Jan 20, 2019

Conversation

mossheim
Copy link
Contributor

@mossheim mossheim commented Jan 15, 2019

Purpose and Motivation

fixes #3352; previously would cause bad behavior with escaped double quotes
inside strings and escaped single quotes inside symbols.

what is essentially happening is that there are two separate lexing
routines - one that lexes individual tokens, and one that performs a
fast look-ahead to find a closing bracket. this bug is in the latter.

when lexing a line like:

"\"".cs

the lookahead lexer routine starts at the first double quote, then
considers the second double quote (the escaped one) to be the end of the
string. then the third double quote is considered the opening of a new
string. however, the normal lexing routine doesn't have this bug, so it
can still succeed.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)

Checklist

  • All tests are passing - there is really not a great way to test this at the moment. I can run
    the regression test suite I wrote but it's not exhaustive, so probably
    beta testing is the best way to get this tested.
  • This PR is ready for review

Remaining Work

  • run regression test suite

fixes #3352; previously would cause bad behavior with escaped double quotes
inside strings and escaped single quotes inside symbols.
@mossheim
Copy link
Contributor Author

Wait for after 3.10.1 to merge

@mossheim mossheim added this to the 3.10.2 milestone Jan 15, 2019
@mossheim mossheim added the comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library" label Jan 15, 2019
Copy link
Contributor

@nhthn nhthn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this change looks correct and also works, thanks!!

@patrickdupuis patrickdupuis merged commit 065f12a into supercollider:3.10 Jan 20, 2019
@mossheim mossheim deleted the issue/3352 branch January 27, 2019 19:37
@mossheim mossheim restored the issue/3352 branch April 10, 2020 18:49
@mossheim mossheim deleted the issue/3352 branch August 1, 2020 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp: sclang sclang C++ implementation (primitives, etc.). for changes to class lib use "comp: class library"
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants