Add ifelseexp

This commit is contained in:
JohnnyMorganz 2021-12-02 11:33:47 +00:00
parent c04dfbf016
commit 219ab146b1

View file

@ -33,10 +33,11 @@ binding ::= Name [`:' typeannotation]
bindinglist ::= (binding | `...') [`,' bindinglist] bindinglist ::= (binding | `...') [`,' bindinglist]
subexpr ::= (asexp | unop subexpr) { binop subexpr } subexpr ::= (asexp | unop subexpr) { binop subexpr }
ifelseexp ::= if exp then exp {elseif exp then exp} else exp
prefixexp ::= NAME | '(' expr ')' prefixexp ::= NAME | '(' expr ')'
primaryexp ::= prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } primaryexp ::= prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs }
asexp ::= simpleexp [`::' typeannotation] asexp ::= simpleexp [`::' typeannotation]
simpleexp ::= NUMBER | STRING | NIL | true | false | ... | constructor | FUNCTION body | primaryexp simpleexp ::= NUMBER | STRING | NIL | true | false | ... | constructor | FUNCTION body | primaryexp | ifelseexp
funcargs ::= `(' [explist] `)' | tableconstructor | String funcargs ::= `(' [explist] `)' | tableconstructor | String
compoundop :: `+=' | `-=' | `*=' | `/=' | `%=' | `^=' | `..=' compoundop :: `+=' | `-=' | `*=' | `/=' | `%=' | `^=' | `..='