
On Fri, Jul 17, 2009 at 11:30:12AM +0300, Marko Mäkelä wrote:
There will be a combinatorial explosion if there is no way to write this kind of rules:
name += ref name += operator
I thought that it would be nice to translate shelter=yes and shelter=no as well, by appending a '+' or '-' to the name. This could be useful when you are bicycling or walking, and you are looking for the nearest shelter to have a break or to escape from a rain shower. To avoid messy rules, I tried to introduce two auxiliary variables, name_ref and name_ref_op: name=* & ref=* { set name_ref='${name} (${ref})' } name=* & ref!=* { set name_ref='${name}' } ref=* & name!=* { set name_ref='${ref}' } name_ref=* & operator=* { set name_ref_op='${name_ref} - ${operator}' } name_ref=* & operator!=* { set name_ref_op='${name_ref}' } operator=* & name_ref!=* { set name_ref_op='${operator}' } No matter if I use 'set' or 'add', the action { name '${name_ref_op}' } will be ignored. Any ideas? While working on this, I mistyped =!* instead of !=*, and the style parser threw an exception. The ugly patch (which does not use any auxiliary variables) is attached. Marko