feat: allow anonymous antiquotations at ParserDescr.nodeWithAntiquot
This commit is contained in:
parent
dfa0b97916
commit
96db4985eb
2 changed files with 3 additions and 3 deletions
|
|
@ -1583,8 +1583,8 @@ def tryAnti (c : ParserContext) (s : ParserState) : Bool :=
|
|||
/- End of Antiquotations -/
|
||||
/- ===================== -/
|
||||
|
||||
def nodeWithAntiquot (name : String) (kind : SyntaxNodeKind) (p : Parser) : Parser :=
|
||||
withAntiquot (mkAntiquot name kind false) $ node kind p
|
||||
def nodeWithAntiquot (name : String) (kind : SyntaxNodeKind) (p : Parser) (anonymous := false) : Parser :=
|
||||
withAntiquot (mkAntiquot name kind anonymous) $ node kind p
|
||||
|
||||
def ident : Parser :=
|
||||
withAntiquot (mkAntiquot "ident" identKind) identNoAntiquot
|
||||
|
|
|
|||
|
|
@ -285,7 +285,7 @@ partial def compileParserDescr (categories : ParserCategories) (d : ParserDescr)
|
|||
| ParserDescr.unary n d => return (← getUnaryAlias parserAliasesRef n) (← visit d)
|
||||
| ParserDescr.binary n d₁ d₂ => return (← getBinaryAlias parserAliasesRef n) (← visit d₁) (← visit d₂)
|
||||
| ParserDescr.node k prec d => return leadingNode k prec (← visit d)
|
||||
| ParserDescr.nodeWithAntiquot n k d => return nodeWithAntiquot n k (← visit d)
|
||||
| ParserDescr.nodeWithAntiquot n k d => return nodeWithAntiquot n k (← visit d) (anonymous := true)
|
||||
| ParserDescr.trailingNode k prec d => return trailingNode k prec (← visit d)
|
||||
| ParserDescr.symbol tk => return symbol tk
|
||||
| ParserDescr.nonReservedSymbol tk includeIdent => return nonReservedSymbol tk includeIdent
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue