feat: add structInstLVal
This commit is contained in:
parent
2abfa1bcff
commit
cdb7e0cfae
1 changed files with 3 additions and 1 deletions
|
|
@ -58,7 +58,9 @@ def haveAssign := parser! " := " >> termParser
|
|||
@[builtinTermParser] def «suffices» := parser! "suffices " >> optIdent >> termParser >> fromTerm >> "; " >> termParser
|
||||
@[builtinTermParser] def «show» := parser! "show " >> termParser >> fromTerm
|
||||
@[builtinTermParser] def «fun» := parser! unicodeSymbol "λ" "fun" >> many1 (termParser appPrec) >> darrow >> termParser
|
||||
def structInstField := parser! ident >> " := " >> termParser
|
||||
def structInstArrayRef := parser! symbol "[" (appPrec+1) >> termParser >>"]"
|
||||
def structInstLVal := (ident <|> structInstArrayRef) >> many (("." >> ident) <|> structInstArrayRef)
|
||||
def structInstField := parser! structInstLVal >> " := " >> termParser
|
||||
def structInstSource := parser! ".." >> optional termParser
|
||||
@[builtinTermParser] def structInst := parser! symbol "{" appPrec >> optional (try (ident >> " . ")) >> sepBy (structInstField <|> structInstSource) ", " true >> "}"
|
||||
def typeSpec := parser! " : " >> termParser
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue