diff --git a/ChangeLog b/ChangeLog index f8539cc26c44d9285fd706375ea50d7475c02c97..3cf70d61c136b33a6cdd81ea3bdd60babf54f5b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-03-22 Jesper Öqvist <jesper.oqvist@cs.lth.se> + + * Added code generation for getXNoTransform(int) to access list children + without triggering rewrites. + 2016-03-21 Jesper Öqvist <jesper.oqvist@cs.lth.se> * Added --safeLazy option which allows non-circular attributes to be diff --git a/src/template/ast/components/ListComponent.tt b/src/template/ast/components/ListComponent.tt index 4c2d0a77e043376019cc7b2119fbc14302b2a9d2..f56e7327877c803f7f676a0ba80d0d1e2e56a45e 100644 --- a/src/template/ast/components/ListComponent.tt +++ b/src/template/ast/components/ListComponent.tt @@ -91,6 +91,16 @@ $endif $SynchEnd } + /** + * @return the element at index {@code i} in the $Name list without + * triggering rewrites. + */ + $Modifier $Type $Host.get$(Name)NoTransform(int i) { + $SynchBegin + return ($Type) (($ListType) getChildNoTransform($Index)).getChildNoTransform(i); + $SynchEnd + } + /** * Check whether the $Name list has any children. * @return {@code true} if it has at least one child, {@code false} otherwise.