[Mapcss] Little syntax easement
Thomas Davie
tom.davie at gmail.com
Mon Feb 6 16:18:25 GMT 2012
On 6 Feb 2012, at 15:47, Tom MacWright wrote:
> > it makes parsing the language significantly harder
>
> Could you be more specific there? I don't see much of a difference. In fact, [ and ] are almost direct stand-ins for tag(' and ').
Previously, one could parse the MapCSS, using a rule along the lines of:
evalSpecifier ::= 'eval' '(' 'String' ')';
you could then take the string, and run a seperate parser over it, allowing the behaviour of MapCSS and the behaviour of eval to be 100% independent, you did not need to worry about tokenising eval constructs while dealing with MapCSS, instead just a string; etc.
Finally, I found that ambiguity that I suspected existed:
way[highway]
{
width: casing-width;
}
Is this text is set to the value of casing-width, or is it set to the value of casing minus the value of width? The fact that - and + are admissable in identifiers makes this ambiguous.
Personally, even if it weren't ambiguous, I would consider the eval('...') solution much cleaner anyway.
More information about the Mapcss
mailing list