Alternative representation of dataspacePatterns

This commit is contained in:
Tony Garnock-Jones 2024-04-09 09:14:01 +02:00
parent 40ca168eac
commit e20c81763b
1 changed files with 11 additions and 7 deletions

View File

@ -6,14 +6,18 @@ embeddedType EntityRef.Cap .
# One key difference is that Dataspace patterns are extensible, in that
# they ignore fields not mentioned in DCompound patterns.
Pattern = DDiscard / DBind / DLit / DCompound .
Pattern =
/ @discard <_>
/ <bind @pattern Pattern>
/ <lit @value AnyAtom>
/ <g @type GroupType @entries { any: Pattern ...:... }>
.
DDiscard = <_>.
DBind = <bind @pattern Pattern>.
DLit = <lit @value AnyAtom>.
DCompound = <rec @label any @fields { int: Pattern ...:... }>
/ <arr @items { int: Pattern ...:... }>
/ <dict @entries { any: Pattern ...:... }> .
GroupType =
/ <rec @label any>
/ <arr>
/ <dict>
.
AnyAtom =
/ @bool bool