osmose-backend icon indicating copy to clipboard operation
osmose-backend copied to clipboard

mapcss functionExpression with booleanExpression arguments fails

Open Famlam opened this issue 1 year ago • 0 comments

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";
}

Famlam avatar Mar 26 '23 21:03 Famlam