aboutsummaryrefslogtreecommitdiff
path: root/Tools
diff options
context:
space:
mode:
Diffstat (limited to 'Tools')
-rw-r--r--Tools/CodeGen/KrancScript.m8
1 files changed, 5 insertions, 3 deletions
diff --git a/Tools/CodeGen/KrancScript.m b/Tools/CodeGen/KrancScript.m
index 0163aaa..e728f14 100644
--- a/Tools/CodeGen/KrancScript.m
+++ b/Tools/CodeGen/KrancScript.m
@@ -121,9 +121,11 @@ process["dtensor"["indices"["lower_index"["index_symbol"["t"]]],tensor_]] :=
dot[process[tensor]];
process["indices"[inds___]] := Map[process, {inds}];
-process["lower_index"[i_]] := TensorIndex[process[i], "l"];
-process["upper_index"[i_]] := TensorIndex[process[i], "u"];
-process["index_symbol"[s_]] := s;
+
+process[(pos:("lower_index"|"upper_index"))["index_symbol"[i_]]] :=
+ If[StringMatchQ[i,DigitCharacter],
+ ToExpression[i],
+ TensorIndex[i, If[pos==="lower_index","l","u"]]];
process["func"["name"[name_],exprs__]] :=
Module[