mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Small fixes
This commit is contained in:
parent
b6d4ac54dc
commit
af25b8dc8f
1 changed files with 5 additions and 5 deletions
|
@ -4,7 +4,7 @@ title: Grammar
|
||||||
toc: true
|
toc: true
|
||||||
---
|
---
|
||||||
|
|
||||||
This is the complete syntax grammar for Luau in EBNF. More information about the terminal nodes Name, String and Number
|
This is the complete syntax grammar for Luau in EBNF. More information about the terminal nodes String and Number
|
||||||
is available in the [syntax section](syntax).
|
is available in the [syntax section](syntax).
|
||||||
|
|
||||||
```
|
```
|
||||||
|
@ -36,9 +36,9 @@ namelist ::= NAME {`,' NAME}
|
||||||
binding ::= NAME [`:' TypeAnnotation]
|
binding ::= NAME [`:' TypeAnnotation]
|
||||||
bindinglist ::= (binding | `...') [`,' bindinglist]
|
bindinglist ::= (binding | `...') [`,' bindinglist]
|
||||||
|
|
||||||
subexpr ::= (asexp | unop subexpr) { binop subexpr }
|
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 | '(' expr ')'
|
prefixexp ::= NAME | '(' exp ')'
|
||||||
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 | ... | tableconstructor | function body | primaryexp | ifelseexp
|
simpleexp ::= NUMBER | STRING | nil | true | false | ... | tableconstructor | function body | primaryexp | ifelseexp
|
||||||
|
@ -51,12 +51,12 @@ fieldsep ::= `,' | `;'
|
||||||
|
|
||||||
compoundop :: `+=' | `-=' | `*=' | `/=' | `%=' | `^=' | `..='
|
compoundop :: `+=' | `-=' | `*=' | `/=' | `%=' | `^=' | `..='
|
||||||
binop ::= `+' | `-' | `*' | `/' | `^' | `%' | `..' | `<' | `<=' | `>' | `>=' | `==' | `~=' | and | or
|
binop ::= `+' | `-' | `*' | `/' | `^' | `%' | `..' | `<' | `<=' | `>' | `>=' | `==' | `~=' | and | or
|
||||||
unop ::= `-' | not | `#´
|
unop ::= `-' | not | `#'
|
||||||
|
|
||||||
SimpleTypeAnnotation ::=
|
SimpleTypeAnnotation ::=
|
||||||
nil |
|
nil |
|
||||||
NAME[`.' NAME] [ `<' TypeAnnotation [`,' ...] `>' ] |
|
NAME[`.' NAME] [ `<' TypeAnnotation [`,' ...] `>' ] |
|
||||||
`typeof' `(' expr `)' |
|
`typeof' `(' exp `)' |
|
||||||
`{' [PropList] `}' |
|
`{' [PropList] `}' |
|
||||||
FunctionTypeAnnotation
|
FunctionTypeAnnotation
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue