Skip to content

mapcss functionExpression with booleanExpression arguments fails #1796

Open
@Famlam

Description

@Famlam

I was curious to see if Osmose could parse the monstrous validator rules of https://josm.openstreetmap.de/ticket/22822#comment:12
https://josm.openstreetmap.de/wiki/Rules/Runways
It turns out, it can't 😢.

Reason: functionExpression expects a valueExpression inside, but here it receives a booleanExpression
Simplified the issue can be brought back to this minimal test case: node[eval(5 >= 5)] (however see also below)
Hence, crashing with the error: no viable alternative at input

Since this doesn't affect active rules, just filing it 'for reference' for now.

For actual support, we also need to implement the boolean ? value : value method, e.g.

node[x][y] {
  throwWarning: "test";
  fixAdd: tag("x") > tag("y") ? "z=x" : "z=y";
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions