> The reason your rule doesn't match the bit of parse tree at line 13, I
> believe,  is that it doesn't account for the *:factor* and *:plus* terms
> in lines 11 and 12.

Correct.

Transformation patterns only match a hash in the tree if all the keys of 
the hash are also present in the pattern.

This is a design decision forced upon us: We cannot partially replace 
hashes (:a => 'a', :b => 'b' - can't replace just the :b part) and would 
loose information in the process, so we don't.

This is normally not a limitation. Given a parser example, it has (up to 
now) always been possible to find a 'good' set of '.as()' annotations 
that generate a tree that can then be transformed. More annotations are 
sometimes better...

regards,
kaspar




Reply via email to