[Swift-commit] r2703 - in trunk: resources src/org/griphyn/vdl/engine

noreply at svn.ci.uchicago.edu noreply at svn.ci.uchicago.edu
Tue Mar 17 10:17:16 CDT 2009


Author: benc
Date: 2009-03-17 10:17:15 -0500 (Tue, 17 Mar 2009)
New Revision: 2703

Modified:
   trunk/resources/Karajan.stg
   trunk/src/org/griphyn/vdl/engine/Karajan.java
Log:
Separate the extractarrayelement template into the two templates that it
really is.

Modified: trunk/resources/Karajan.stg
===================================================================
--- trunk/resources/Karajan.stg	2009-03-17 15:16:13 UTC (rev 2702)
+++ trunk/resources/Karajan.stg	2009-03-17 15:17:15 UTC (rev 2703)
@@ -436,25 +436,18 @@
 <variable>$var$</variable>
 >>
 
-// TODO this would more cleanly be two templates, one for structure
-// access and one for array access.
-
-extractarrayelement(parent, arraychild, memberchild, datatype) ::= <<
-
-$if(arraychild)$
+extractarrayelement(parent, arraychild, datatype) ::= <<
 <vdl:getfieldsubscript>
   <argument name="var">$parent$</argument>
   <argument name="subscript">$arraychild$</argument>
 </vdl:getfieldsubscript>
-$endif$
+>>
 
-$if(memberchild)$
+extractstructelement(parent, memberchild, datatype) ::= <<
 <getfield>
   <argument name="var">$parent$</argument>
   <argument name="path">$memberchild$</argument>
 </getfield>
-$endif$
-
 >>
 
 slicearray(parent, memberchild, datatype) ::= <<

Modified: trunk/src/org/griphyn/vdl/engine/Karajan.java
===================================================================
--- trunk/src/org/griphyn/vdl/engine/Karajan.java	2009-03-17 15:16:13 UTC (rev 2702)
+++ trunk/src/org/griphyn/vdl/engine/Karajan.java	2009-03-17 15:17:15 UTC (rev 2703)
@@ -1047,7 +1047,7 @@
 				newst.setAttribute("datatype", actualType); 
 				return newst;
 			} else {
-				StringTemplate newst = template("extractarrayelement");
+				StringTemplate newst = template("extractstructelement");
 				newst.setAttribute("parent", parentST);
 				newst.setAttribute("memberchild", sm.getMemberName());
 				newst.setAttribute("datatype", actualType); 




More information about the Swift-commit mailing list