if (<exp>) {
 some rules
} else {
other rules
}

That's exactly what I had in mind. Adding another parameter, like a CONSTANT, to the invocation would work (especially for the case of building clutter) but is not nearly as flexible or powerful as an internal if-then-else capability to process style rules and act on them conditionally.


On Wed, Feb 8, 2017 at 4:35 AM, Andrzej Popowski <popej@poczta.onet.pl> wrote:
Hi Gerd,

could you implement simple conditional statements, which would be analyzed at the stage of reading style? Similarly like statement "include" is processed.

I think the simplest version would contain 3 tokens:
ifdefined CONSTANT
ifnotdefined CONSTANT
endif

Scanner should look for ifdefined/ifnotdefined, check if CONSTANT exist and then analyze or skip rules until it finds token endif. It should support nesting. CONSTANT would be given as command line option. Or maybe even as an additional token, like "define CONSTANT".


--
Best regards,
Andrzej

_______________________________________________
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev



--
Dave Swarthout
Homer, Alaska
Chiang Mai, Thailand
Travel Blog at http://dswarthout.blogspot.com