mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Breakdown primaryexp
Into `prefixexp`, `var` and `functioncall`. Same as Lua5.1+
This commit is contained in:
parent
da0a15a11d
commit
d206fe408e
1 changed files with 6 additions and 3 deletions
|
@ -36,12 +36,15 @@ namelist ::= NAME {`,' NAME}
|
||||||
binding ::= NAME [`:' TypeAnnotation]
|
binding ::= NAME [`:' TypeAnnotation]
|
||||||
bindinglist ::= binding [`,' bindinglist]
|
bindinglist ::= binding [`,' bindinglist]
|
||||||
|
|
||||||
|
var ::= NAME | prefixexp `[' exp `]' | prefixexp `.' Name
|
||||||
|
varlist ::= var {`,' var}
|
||||||
|
prefixexp ::= var | functioncall | `(' exp `)'
|
||||||
|
functioncall ::= prefixexp funcargs | prefixexp `:' NAME funcargs
|
||||||
|
|
||||||
exp ::= (asexp | unop exp) { binop exp }
|
exp ::= (asexp | unop exp) { binop exp }
|
||||||
ifelseexp ::= if exp then exp {elseif exp then exp} else exp
|
ifelseexp ::= if exp then exp {elseif exp then exp} else exp
|
||||||
prefixexp ::= NAME | '(' exp ')'
|
|
||||||
primaryexp ::= prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs }
|
|
||||||
asexp ::= simpleexp [`::' Type]
|
asexp ::= simpleexp [`::' Type]
|
||||||
simpleexp ::= NUMBER | STRING | nil | true | false | `...' | tableconstructor | function body | primaryexp | ifelseexp
|
simpleexp ::= NUMBER | STRING | nil | true | false | `...' | tableconstructor | function body | prefixexp | ifelseexp
|
||||||
funcargs ::= `(' [explist] `)' | tableconstructor | STRING
|
funcargs ::= `(' [explist] `)' | tableconstructor | STRING
|
||||||
|
|
||||||
tableconstructor ::= `{' [fieldlist] `}'
|
tableconstructor ::= `{' [fieldlist] `}'
|
||||||
|
|
Loading…
Add table
Reference in a new issue