Opened 11 years ago
Closed 11 years ago
#10066 closed enhancement (wontfix)
[Patch] MapCSS parser: skip all whitespace
Reported by: | simon04 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Internal mappaint style | Version: | |
Keywords: | Cc: | bastiK |
Description
In order to resolve the limitation "JOSM MapCSS is not liberal with white spaces in the selector…" from wiki:Help/Styles/MapCSSImplementation, we could ignore whitespaces at the lexing phase, i.e., by using the JavaCC SKIP
keyword …
With this modification, also [highway ! = footway]
would be parsed correctly (note the space between !
and =
). To get around this, one would have to combine <EXCLAMATION> <EQUAL>
into one token like it is done for <PIPE_Z>
.
Is there a special reason, why whitespace handling is done in each grammar rule separately?
Attachments (1)
Change History (3)
by , 11 years ago
Attachment: | parser.jj.patch added |
---|
comment:1 by , 11 years ago
comment:2 by , 11 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
hm, right. I didn't think of that – let's keep it as it is. :-)
Also from the wiki:
The idea behind this is strict compliance with the CSS standard:
matches a paragraph
<p class="info">
, butmatches elements inside a paragraph with class info, e.g.
<p>x<span class="info">y</span></p>
.This means that white space cannot be ignored because it makes a descendant selector.
Now MapCSS is not the same as CSS, but the idea was to use the CSS standard, unless there is a reason not to.
In this case, the reason would be, that it is just easier if you can put white-space anywhere. But this argument doesn't convince me. :)