Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

extra closing bracket only triggers parse error if trailing space or newline is present #204

Closed
springmeyer opened this issue Oct 21, 2012 · 4 comments
Labels
Milestone

Comments

@springmeyer
Copy link

CSS like this is invalid but does not throw:

#countries {
  polygon-fill: green;
}}

Whereas this does properly throw:

#countries {
  polygon-fill: green;
}}

The difference is subtle. To replicate in TileMill simply make sure that no extra space or lines are present after the }}. Curiously, after no error is thrown the map still displays correctly.

@tmcw
Copy link
Contributor

tmcw commented Dec 18, 2012

Are you able to replicate this with the carto binary? I can only get this bug in TileMill.

@springmeyer
Copy link
Author

Yes, I just pushed a branch called mss-renderer. With that branch I get:

$ ./node_modules/.bin/mocha test/errorhandling.test.js ��������������

  ․․․․․․․․․․․․․․․․*** <--- WARNING invalid error handling test found (/Users/dane/projects/tilemill/node_modules/carto/test/errorhandling/issue_214_a.mss): all error handling tests should throw errors!
․․․․․․․․

  ✔ 24 tests complete (69ms)

Also with the binary I see:

$ ./bin/carto test/errorhandling/issue_214_a.mss ��������������
<Style name="style" filter-mode="first" >
  <Rule>
    <PolygonSymbolizer fill="#008000" />
  </Rule>
</Style>

@tmcw
Copy link
Contributor

tmcw commented Dec 27, 2012

Fixed with the new chunker in condense, and this now throws the correct error, as well as the correct error for unmatched {.

@tmcw tmcw closed this as completed Dec 27, 2012
@springmeyer
Copy link
Author

awesome!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants