schema: extract And clauses

This commit is contained in:
Emery Hemingway 2023-12-16 00:21:28 +02:00
parent 218ca7a669
commit 40f20a3ca8
1 changed files with 3 additions and 1 deletions

View File

@ -136,7 +136,9 @@ const parser = peg("Schema", p: ParseState):
initRecord(toSymbol"lit", parsePreserves $1)]
pushStack n
AndPattern <- ?('&' * S) * NamedPattern * +(S * '&' * S * NamedPattern)
AndPattern <- ?('&' * S) * NamedPattern * +(S * '&' * S * NamedPattern):
var node = initRecord(toSymbol("and"), toPreserve takeStackAt())
pushStack node
Pattern <- SimplePattern | CompoundPattern