forked from syndicate-lang/preserves
Repair errors in preserves-schema.md
This commit is contained in:
parent
b73e0c7025
commit
0507ab2f38
|
@ -159,7 +159,7 @@ identifierlike" literal pattern - one that matches a string, symbol,
|
||||||
number or boolean:
|
number or boolean:
|
||||||
|
|
||||||
AltPattern = "@" id SimplePattern
|
AltPattern = "@" id SimplePattern
|
||||||
/ "<" id *(NamedPattern) ">"
|
/ "<" id PatternSequence ">"
|
||||||
/ Ref
|
/ Ref
|
||||||
/ LiteralPattern -- with a side condition
|
/ LiteralPattern -- with a side condition
|
||||||
|
|
||||||
|
@ -282,10 +282,20 @@ identifier.
|
||||||
|
|
||||||
A record pattern matches an input record. It may be specified as a
|
A record pattern matches an input record. It may be specified as a
|
||||||
record with a literal in the label position, or as a quoted `<<rec>
|
record with a literal in the label position, or as a quoted `<<rec>
|
||||||
... >` record:
|
... >` record with a pattern for each of the label and field-sequence
|
||||||
|
positions:[^record-shorthand]
|
||||||
|
|
||||||
RecordPattern = "<<rec>" NamedPattern *(NamedPattern) ">"
|
RecordPattern = "<<rec>" NamedPattern NamedPattern ">"
|
||||||
/ "<" value *(NamedPattern) ">"
|
/ "<" value PatternSequence ">"
|
||||||
|
|
||||||
|
PatternSequence = *(NamedPattern) [NamedSimplePattern "..."]
|
||||||
|
|
||||||
|
[^record-shorthand]: Note that `<label `*ps*`>` can be thought of as
|
||||||
|
roughly equivalent to `<<rec> <<lit> label> [`*ps*`]>`. The
|
||||||
|
following two definitions are equivalent:
|
||||||
|
|
||||||
|
D1 = <foo @a string @b string @extra any ... >.
|
||||||
|
D2 = <<rec> <<lit> foo> [@a string @b string @extra any ...]>.
|
||||||
|
|
||||||
A tuple pattern matches a fixed-length sequence with specific patterns
|
A tuple pattern matches a fixed-length sequence with specific patterns
|
||||||
in each position. A variable tuple pattern is the same, but with an
|
in each position. A variable tuple pattern is the same, but with an
|
||||||
|
@ -293,7 +303,7 @@ additional pattern for matching additional elements following the
|
||||||
fixed-position patterns.
|
fixed-position patterns.
|
||||||
|
|
||||||
TuplePattern = "[" *(NamedPattern) "]"
|
TuplePattern = "[" *(NamedPattern) "]"
|
||||||
VariableTuplePattern = "[" 1*(NamedPattern) NamedSimplePattern "..." "]"
|
VariableTuplePattern = "[" *(NamedPattern) NamedSimplePattern "..." "]"
|
||||||
|
|
||||||
A dictionary pattern matches specific literal keys in an input
|
A dictionary pattern matches specific literal keys in an input
|
||||||
dictionary. If no explicit name is given for a particular
|
dictionary. If no explicit name is given for a particular
|
||||||
|
|
Loading…
Reference in New Issue