diff --git a/docs/_pages/grammar.md b/docs/_pages/grammar.md index c296f268..2062c297 100644 --- a/docs/_pages/grammar.md +++ b/docs/_pages/grammar.md @@ -63,15 +63,14 @@ SimpleType = NAME ['.' NAME] [ '<' [TypeParams] '>' ] | 'typeof' '(' exp ')' | TableType | - FunctionType + FunctionType | + '(' SimpleType ')' SingletonType = STRING | 'true' | 'false' -Type = - Type ['?'] | - Type ['|' Type] | - Type ['&' Type] | - '(' Type ')' +UnionSuffix = {'?'} ['|' SimpleType] +IntersectionSuffix = ['&' SimpleType] +Type = SimpleType {UnionSuffix | IntersectionSuffix} GenericTypePackParameter = NAME '...' GenericTypeList = NAME [',' GenericTypeList] | GenericTypePackParameter {',' GenericTypePackParameter}