Unfortunately I do no longer have the original code. But adding to my working lines-file the following snippet
if (hgh:Trasse=no) then
() [0x01 road_class=4 level 3]
else
if (hgh:surface=Race) then
() [0x01 road_class=4 level 3]
else
() [0x01 road_class=4 level 3]
end
end
(starting at line 142) immediately reproduces the error @ style check (although pointing to line 149; the first “end”)
The following styles are available:
SCHWERWIEGEND (global): Error in style: Error: (lines:149): Invalid rule, expression cannot be indexed: $hgh:Trasse!=no & $hgh:surface!=Race
Found one style in /home/felix/AA-Poolm/osm/Styles/HGH-BikeLayer-style
SCHWERWIEGEND (global): Error in style: Error: (lines:149): Invalid rule, expression cannot be indexed: $hgh:Trasse!=no & $hgh:surface!=Race
could not open style HGH-BikeLayer-style
finished check-styles
Mkgmap version 4806
Time started: Fri Nov 12 13:46:59 CET 2021
SCHWERWIEGEND (global): Error in style: Error: (lines:149): Invalid rule, expression cannot be indexed: $hgh:Trasse!=no & $hgh:surface!=Race
The last line is repeated quite often.
From my understanding the "!"s reflect to the “else” statements and are generated during parsing the if-construct, aren’t they?.
OK, I see.
“…the only restriction is you must have at least one test that depends on a tag existing” (style manual). Wouldn’t have read that this way, but that’s it, is it not?
Thanks!
Although I would have thought, there should have been at least one not negative test in the nested else branch in the original code, it probably was exactly these simplified pair of brackets only, meant to catch the rest, that failed all former tests.
In any case,
# Test
() {set hgh:test=yes}
if (hgh:Trasse=no) then
() [0x01 road_class=4 level 3]
else
if (hgh:surface=Race) then
() [0x01 road_class=4 level 3]
else
hgh:test=yes [0x01 road_class=4 level 3]
end
end
shure stylechecks fine.
Will reorganize my original code back to those nested ifs later and take better care…