diff options
-rw-r--r-- | Auxiliary/Grammars/kranc2.peg | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Auxiliary/Grammars/kranc2.peg b/Auxiliary/Grammars/kranc2.peg index 7017b42..15c183c 100644 --- a/Auxiliary/Grammars/kranc2.peg +++ b/Auxiliary/Grammars/kranc2.peg @@ -6,7 +6,7 @@ indices = ([_^]([a-zA-Z]'*)+)* tensor = {name}{indices} dtensor = D{indices} {tensor} number = -?[0-9]+(\.[0-9]*|)([eEdD][+-]?[0-9]+|) -func = {name} \( {expr} \) +func = {name} \( ({expr}( , {expr})*|) \) value = {func}|{dtensor}|{tensor}|{number}|\( {expr} \) pow = {value}( \*\* {value}|) mulop = [*/%] @@ -15,5 +15,7 @@ addop = [+-] expr = {mul}( {addop} {mul})* eqn = ({dtensor}|{tensor}) \= {expr}{-end} eqns = {eqn}( {eqn})* -thorn = begin[ ]+thorn {name}{-end}( {calculation})* end[ ]+thorn -calculation = begin[ ]+calculation {uname}{-end} {eqns} end[ ]+calculation +thorn = begin[ ]+thorn {name}{-end}( {calculation}| {variables}| {temporaries})* end[ ]+thorn +calculation = begin[ \t]+calculation[ \t]+{uname}{-end} {eqns} end[ \t]+calculation +variables = begin[ \t]+variables{-end} {name}( end[ \t]+variables\b{brk}| {name})*{-end} +temporaries = begin[ \t]+temporaries{-end} {name}( end[ \t]+temporaries\b{brk}| {name})*{-end} |