STR-769: implode-asfix returns a wrong AST if attrs() contains additionnal terms that match cons().
$ echo ‘parsetree(appl(prod([], cf(sort(“Dummy”)), attrs([term(my_attr(cons(“Foo”))),term(cons(“dummy”))])), []), 0)’|implode-asfix
FooThe problem seems to be in stratego-libraries/sglr/lib/stratego/asfix/implode/constructor.str (Constr0 and get-cons).
Something like
Constr0: prod(_, _, as) -> x where <attrs(fetch-elem(?term(cons(x)))) <+ id> asinstead of
/**
* @todo Optimize the oncetd
*/
Constr0 :
prod(_, _, as) -> x
where
<oncetd(?cons(x))> asshould do what we expect. The same change should be done in get-cons/0.
Submitted on 21 March 2009 at 14:03
Log in to post comments