Opened 14 years ago
Closed 14 years ago
#5985 closed defect (fixed)
MapCSS conditions don't handle unquoted numeric values
Reported by: | framm | Owned by: | bastiK |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Internal mappaint style | Version: | |
Keywords: | mapcss | Cc: |
Description
The MapCSS implementation (great work!) does not allow unquoted values that begin with a number, e.g.
way[width=5] { ... }
doesn't work (and not display an error message either), whereas
way[width=five] { ... }
and
way[width="5"] { ... }
both work. This is probably due to simple_key_value_condition expecting a "string_or_ident" value, and IDENT must always begin with a letter, and STRING must always begin with double quotes. It is non-intiutive that one has to use quotes if the value is numeric; Potlatch does not require it. Can it be fixed without completely breaking the parser?
Replying to framm:
"width=5" is parsed as expression where the string "width" is compared to the integer 5 and it evaluates to false. So the error handling is a little problematic because formally, there is no error.
sure