logo separator

[mkgmap-dev] if-then-else in style and style options

From Gerd Petermann GPetermann_muenchen at hotmail.com on Fri Mar 10 08:10:40 GMT 2017

Hi Andrzej,

okay, I think that meant I should apply the patch, done with r3839.

I've also checked your idea for the shorter form. I first thought it is simple but then noticed that
you didn't specify the continue statement in the shorter form.
I guess you want that to be added automatically. Does that also mean that "with_actions" should
be added automatically if there are actions?
In other words: If we have
a=b {name ... } [0x0C ... resolution 24] [0x10801 resolution 18]
would that be the same as
a=b {name ... } [0x0C ... resolution 24 continue with_actions]
a=b [0x10801 resolution 18]

I guess that also means we should allow
a=b {name ... } [0x0C ... resolution 24] {set ... } [0x10801 resolution 18]
as a replacement for
a=b {name ... } [0x0C ... resolution 24 continue with_actions]
a=b {set ... }  [0x10801 resolution 18]

Now, I think that mens we should also allow 
a=b {name ... } [0x0C ... resolution 24] {set c=2 } 
as a repelacement for 
a=b {name ... } [0x0C ... resolution 24 continue with_actions]
a=b  {set c=2 } 

The attached patch seems to implement it that way and contains some unit tests. 
I hope it doesn't mess up error handling when the style contains syntax errors.

Gerd

________________________________________
Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag von Andrzej Popowski <popej at poczta.onet.pl>
Gesendet: Donnerstag, 9. März 2017 14:57:11
An: mkgmap-dev at lists.mkgmap.org.uk
Betreff: Re: [mkgmap-dev] if-then-else in style and style options

Hi Gerd,

I don't think that kind of expression is necessary, unless it speeds up
compilation, which it probably doesn't in current implementation. But it
would be nice to have it. Maybe using keyword "apply" would help?
Similarly like in relations.

Just another thought, could we get following syntax:
junction=roundabout & (highway=trunk | highway=trunk_link) [0x0c
road_class=4 road_speed=2 resolution 24][0x10801 resolution 18]

instead of 2 rules:
junction=roundabout & (highway=trunk | highway=trunk_link) [0x0c
road_class=4 road_speed=2 resolution 24 continue]
junction=roundabout & (highway=trunk | highway=trunk_link) [0x10801
resolution 18]

--
Best regards,
Andrzej
_______________________________________________
mkgmap-dev mailing list
mkgmap-dev at lists.mkgmap.org.uk
http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: reuse-expression-v1.patch
Type: application/octet-stream
Size: 4909 bytes
Desc: reuse-expression-v1.patch
URL: <http://www.mkgmap.org.uk/pipermail/mkgmap-dev/attachments/20170310/ed03cf31/attachment.obj>


More information about the mkgmap-dev mailing list