From 71cd9cc5832038462d54cb0b84f4ce141e02b47f Mon Sep 17 00:00:00 2001 From: Cameron Purdy <699204+cpurdy@users.noreply.github.com> Date: Wed, 22 Jun 2022 16:44:16 -0400 Subject: [PATCH] Preparation work for type changes; see: https://github.com/xtclang/xvm/discussions/36 --- doc/bnf.x | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/doc/bnf.x b/doc/bnf.x index a88b411fe2..23cbadc6ab 100644 --- a/doc/bnf.x +++ b/doc/bnf.x @@ -136,9 +136,9 @@ ElseComposition Composition "extends" TypeExpression ArgumentList-opt "implements" ExtendedTypeExpression - "delegates" ExtendedTypeExpression "(" Expression ")" + "delegates" AnyTypeExpression "(" Expression ")" "incorporates" IncorporatesFinish - "into" ExtendedTypeExpression + "into" AnyTypeExpression ImportClause QualifiedName VersionRequirement-opt "default" "(" Expression ")" @@ -579,7 +579,7 @@ UsingStatement "using" "(" UsingResources ")" StatementBlock TypeDefStatement - "typedef" ExtendedTypeExpression "as" Name ";" + "typedef" AnyTypeExpression "as" Name ";" # # expressions @@ -730,8 +730,8 @@ PostfixExpression PostfixExpression NoWhitespace "?" PostfixExpression "." "&"-opt Name TypeParameterTypeList-opt PostfixExpression ".new" NewFinish - PostfixExpression ".as" "(" ExtendedTypeExpression ")" - PostfixExpression ".is" "(" ExtendedTypeExpression ")" + PostfixExpression ".as" "(" AnyTypeExpression ")" + PostfixExpression ".is" "(" AnyTypeExpression ")" ArrayDims "[" DimIndicators-opt "]" @@ -1086,6 +1086,22 @@ TypeExpression ExtendedTypeExpression ExtendedUnionedTypeExpression +AnyTypeExpression + AnonTypeExpression + ExtendedTypeExpression + +AnonTypeExpression + "{" NameOrSignatureList ";" "}" # note: at least one name or signature is required + +NameOrSignatureList + NameOrSignature + NameOrSignatureList ";" NameOrSignature + +NameOrSignature + Name # ref to 1+ property/method + PropertyModifiers-opt TypeExpression Name # property + MethodModifiers-opt TypeParameterList-opt MethodIdentity ParameterList # method + # '+' creates a union of two types; '-' creates a difference of two types UnionedTypeExpression IntersectingTypeExpression @@ -1102,6 +1118,7 @@ IntersectingTypeExpression IntersectingTypeExpression | NonBiTypeExpression ExtendedIntersectingTypeExpression + AnonTypeExpression ExtendedNonBiTypeExpression ExtendedIntersectingTypeExpression | ExtendedNonBiTypeExpression