mirror of
https://github.com/luau-lang/luau.git
synced 2025-05-04 10:33:46 +01:00
Change out varlist to GenericTypeList
The original definition is wrong, since generic lists can also have generic type packs (...)
This commit is contained in:
parent
6d4d0268eb
commit
b97356787b
1 changed files with 4 additions and 3 deletions
|
@ -19,7 +19,7 @@ stat ::= varlist `=' explist |
|
||||||
function funcname funcbody |
|
function funcname funcbody |
|
||||||
local function Name funcbody |
|
local function Name funcbody |
|
||||||
local namelist [`=' explist] |
|
local namelist [`=' explist] |
|
||||||
[export] type Name [`<' varlist `>'] `=' typeannotation
|
[export] type Name [`<' GenericTypeList `>'] `=' typeannotation
|
||||||
|
|
||||||
laststat ::= return [explist] | break | continue
|
laststat ::= return [explist] | break | continue
|
||||||
|
|
||||||
|
@ -52,8 +52,9 @@ typeannotation ::=
|
||||||
`(' [TypeList] `)' `->` ReturnType
|
`(' [TypeList] `)' `->` ReturnType
|
||||||
`typeof` typeannotation
|
`typeof` typeannotation
|
||||||
|
|
||||||
typeannotation ::= nil | Name[`.' Name] [ `<' typeannotation [`,' ...] `>' ] | `typeof' `(' expr `)' | `{' [PropList] `}' | [`<' varlist `>'] `(' [TypeList] `)' `->` ReturnType
|
typeannotation ::= nil | Name[`.' Name] [ `<' typeannotation [`,' ...] `>' ] | `typeof' `(' expr `)' | `{' [PropList] `}' | [`<' GenericTypeList `>'] `(' [TypeList] `)' `->` ReturnType
|
||||||
|
|
||||||
|
GenericTypeList ::= NAME [`...'] {`,' NAME}
|
||||||
TypeList ::= TypeAnnotation [`,' TypeList] | ...TypeAnnotation
|
TypeList ::= TypeAnnotation [`,' TypeList] | ...TypeAnnotation
|
||||||
ReturnType ::= TypeAnnotation | `(' TypeList `)'
|
ReturnType ::= TypeAnnotation | `(' TypeList `)'
|
||||||
TableIndexer ::= `[' TypeAnnotation `]' `:' TypeAnnotation
|
TableIndexer ::= `[' TypeAnnotation `]' `:' TypeAnnotation
|
||||||
|
@ -61,6 +62,6 @@ TableProp ::= Name `:' TypeAnnotation
|
||||||
TablePropOrIndexer ::= TableProp | TableIndexer
|
TablePropOrIndexer ::= TableProp | TableIndexer
|
||||||
PropList ::= TablePropOrIndexer {fieldsep TablePropOrIndexer} [fieldsep]
|
PropList ::= TablePropOrIndexer {fieldsep TablePropOrIndexer} [fieldsep]
|
||||||
TableTypeAnnotation ::= `{' PropList `}'
|
TableTypeAnnotation ::= `{' PropList `}'
|
||||||
FunctionTypeAnnotation ::= [`<' varlist `>'] `(' [TypeList] `)' `->` ReturnType
|
FunctionTypeAnnotation ::= [`<' GenericTypeList `>'] `(' [TypeList] `)' `->` ReturnType
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Reference in a new issue