Add associative map constraints and range refinement

This commit is contained in:
2026-08-14 06:26:15 +09:00
parent 8198b615a8
commit cc6ab40807
52 changed files with 8951 additions and 6918 deletions
+11 -1
View File
@@ -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,