From 765a02333ec5855f29a75010aab162a445b76ea9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Jesper=20=C3=96qvist?= <jesper.oqvist@cs.lth.se>
Date: Tue, 22 Mar 2016 14:41:58 +0100
Subject: [PATCH] Generate getXNoTransform(int) for list children

fixes #254 (bitbucket)
---
 ChangeLog                                    |  5 +++++
 src/template/ast/components/ListComponent.tt | 10 ++++++++++
 2 files changed, 15 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index f8539cc2..3cf70d61 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 4c2d0a77..f56e7327 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.
-- 
GitLab