chore: prepare to change structInst syntax
This commit is contained in:
parent
bb6945d384
commit
27e26998d2
1 changed files with 10 additions and 1 deletions
|
|
@ -70,7 +70,16 @@ def sufficesDecl := optIdent >> termParser >> (fromTerm <|> byTactic)
|
|||
def structInstArrayRef := parser! "[" >> termParser >>"]"
|
||||
def structInstLVal := (ident <|> fieldIdx <|> structInstArrayRef) >> many (group ("." >> (ident <|> fieldIdx)) <|> structInstArrayRef)
|
||||
def structInstField := ppGroup $ parser! structInstLVal >> " := " >> termParser
|
||||
@[builtinTermParser] def structInst := parser! "{" >> ppHardSpace >> optional (atomic (termParser >> " with ")) >> sepBy structInstField ", " true >> optional ".." >> optional (" : " >> termParser) >> " }"
|
||||
@[builtinTermParser] def structInst := parser!
|
||||
(checkInsideQuot >>
|
||||
"{" >> ppHardSpace >> optional (atomic (termParser >> " with "))
|
||||
>> manyIndent (group (structInstField >> optional ", "))
|
||||
>> optional ".."
|
||||
>> optional (" : " >> termParser) >> " }")
|
||||
<|>
|
||||
(checkOutsideQuot >>
|
||||
"{" >> ppHardSpace >> optional (atomic (termParser >> " with ")) >> sepBy structInstField ", " true >> optional ".." >> optional (" : " >> termParser) >> " }")
|
||||
|
||||
def typeSpec := parser! " : " >> termParser
|
||||
def optType : Parser := optional typeSpec
|
||||
@[builtinTermParser] def explicit := parser! "@" >> termParser maxPrec
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue