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

error message caused by curly bracket in a println string #3394

Closed
kasperkamperman opened this Issue Jun 17, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@kasperkamperman

kasperkamperman commented Jun 17, 2015

The code below give the following error: Found a { that's missing a matching }

// gives the error
  if(luminanceCurveInSteadOfGamma) {
    println("const uint16_t luminanceLUT[] = {");
  }
  else {
    println("const uint16_t gammaLUT[] = {");
  }
// doesn't give the error
  if(luminanceCurveInSteadOfGamma) {
    println("const uint16_t luminanceLUT[] = {");
  }
  else {
    //println("const uint16_t gammaLUT[] = {");
  }

The error warning algorithm doesn't seem to see that the curly bracket in the String is not part of the code. At least with multiple lines that do this.

Processing 3.0a10
OSX 10.10.3

@benfry benfry added the high label Jun 17, 2015

@benfry benfry added this to the 3.0 beta 1 milestone Jun 17, 2015

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jun 17, 2015

Member

Nuts, that's probably the new size() parsing. Will fix asap.

Member

benfry commented Jun 17, 2015

Nuts, that's probably the new size() parsing. Will fix asap.

@Manindra29

This comment has been minimized.

Show comment
Hide comment
@Manindra29

Manindra29 Jun 24, 2015

Member

((?<![\\])['"])((?:.(?!(?<![\\])\1))*.?)\1 can match all quoted strings (source). Might be useful here.

Member

Manindra29 commented Jun 24, 2015

((?<![\\])['"])((?:.(?!(?<![\\])\1))*.?)\1 can match all quoted strings (source). Might be useful here.

@benfry

This comment has been minimized.

Show comment
Hide comment
@benfry

benfry Jun 24, 2015

Member

We have to match both quoted and unquoted cases, i.e. P3D or "processing.opengl.PGraphics3D so it's even worse than that.

Member

benfry commented Jun 24, 2015

We have to match both quoted and unquoted cases, i.e. P3D or "processing.opengl.PGraphics3D so it's even worse than that.

@Manindra29

This comment has been minimized.

Show comment
Hide comment
@Manindra29

Manindra29 Jun 24, 2015

Member

Then maybe try to match all the expected quoted strings, save any if found,
and then replace all quoted strings with spaces to avoid this issue?

There may be a simpler way though.
On Jun 24, 2015 8:04 AM, "Ben Fry" notifications@github.com wrote:

We have to match both quoted and unquoted cases, i.e. P3D or
"processing.opengl.PGraphics3D so it's even worse than that.


Reply to this email directly or view it on GitHub
#3394 (comment)
.

Member

Manindra29 commented Jun 24, 2015

Then maybe try to match all the expected quoted strings, save any if found,
and then replace all quoted strings with spaces to avoid this issue?

There may be a simpler way though.
On Jun 24, 2015 8:04 AM, "Ben Fry" notifications@github.com wrote:

We have to match both quoted and unquoted cases, i.e. P3D or
"processing.opengl.PGraphics3D so it's even worse than that.


Reply to this email directly or view it on GitHub
#3394 (comment)
.

@benfry benfry closed this in 87f8a3d Jun 26, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment