Add associative map constraints and range refinement
This commit is contained in:
@@ -5,7 +5,12 @@ Statement {
|
||||
Expression Semicolon?
|
||||
}
|
||||
|
||||
Expression { DefaultExpression }
|
||||
Expression { AsExpression }
|
||||
|
||||
AsExpression {
|
||||
DefaultExpression |
|
||||
AsExpression !as As DefaultExpression
|
||||
}
|
||||
|
||||
DefaultExpression {
|
||||
PatchExpression |
|
||||
@@ -70,6 +75,7 @@ PrimaryExpression {
|
||||
Literal |
|
||||
Identifier |
|
||||
ComparisonConstraint |
|
||||
MapConstraint |
|
||||
Object |
|
||||
ArrayConstraint |
|
||||
Array |
|
||||
@@ -85,6 +91,7 @@ CompareOperator { EqualEqual | BangEqual | Lt | Lte | Gt | Gte }
|
||||
ComparisonConstraint { (Lt | Lte | Gt | Gte) Expression }
|
||||
|
||||
Object { LBrace (FieldDefinition (Semicolon FieldDefinition)* Semicolon?)? RBrace }
|
||||
MapConstraint { LBrace Ellipsis Expression RBrace }
|
||||
FieldDefinition { FieldPath Equal Expression }
|
||||
FieldPath { Identifier !fieldPath (Dot Identifier)* }
|
||||
|
||||
@@ -104,8 +111,11 @@ Pattern { Underscore | Expression }
|
||||
|
||||
ImportExpression { Import String }
|
||||
|
||||
As { @specialize<Identifier, "as"> }
|
||||
|
||||
@precedence {
|
||||
fieldPath @left,
|
||||
as @left,
|
||||
default @right,
|
||||
patch @left,
|
||||
compose @left,
|
||||
|
||||
Reference in New Issue
Block a user