From 407247df97f7072fc841b03d748ee69cc830ba2b Mon Sep 17 00:00:00 2001 From: JohnnyMorganz Date: Tue, 2 May 2023 19:59:04 +0100 Subject: [PATCH] Apply changes --- docs/_pages/grammar.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/_pages/grammar.md b/docs/_pages/grammar.md index 5903c6ee..20dce193 100644 --- a/docs/_pages/grammar.md +++ b/docs/_pages/grammar.md @@ -68,15 +68,19 @@ SimpleType = SingletonType = STRING | 'true' | 'false' -UnionSuffix = {'?'} ['|' SimpleType] -IntersectionSuffix = ['&' SimpleType] -Type = SimpleType {UnionSuffix} | SimpleType {IntersectionSuffix} +UnionSuffix = {'?'} {'|' SimpleType {'?'}} +IntersectionSuffix = {'&' SimpleType} +Type = SimpleType (UnionSuffix | IntersectionSuffix) GenericTypePackParameter = NAME '...' GenericTypeList = NAME [',' GenericTypeList] | GenericTypePackParameter {',' GenericTypePackParameter} -GenericTypePackParameterWithDefault = NAME '...' ['=' (TypePack | VariadicTypePack | GenericTypePack)] -GenericTypeListWithDefaults = NAME ['=' Type] [',' GenericTypeListWithDefaults] | GenericTypePackParameterWithDefault {',' GenericTypePackParameterWithDefault} +GenericTypePackParameterWithDefault = NAME '...' '=' (TypePack | VariadicTypePack | GenericTypePack) +GenericTypeListWithDefaults = + GenericTypeList | + NAME {',' NAME} {',' NAME '=' Type} {',' GenericTypePackParameterWithDefault} | + NAME '=' Type {',' GenericTypePackParameterWithDefault} | + GenericTypePackParameterWithDefault {',' GenericTypePackParameterWithDefault} TypeList = Type [',' TypeList] | '...' Type TypeParams = (Type | TypePack | VariadicTypePack | GenericTypePack) [',' TypeParams]