remove square brackets around type lines
(parens are needed if they are anything other than a `term arg`)
This commit is contained in:
parent
d631b86be3
commit
64de93a13c
7 changed files with 42 additions and 35 deletions
|
@ -245,15 +245,6 @@ export
|
|||
term : FileName -> Grammar True PTerm
|
||||
-- defined after all the subterm parsers
|
||||
|
||||
export
|
||||
typeLine : FileName -> Grammar True (PatVar, PTerm)
|
||||
typeLine fname = do
|
||||
resC "["
|
||||
mustWork $ do
|
||||
i <- patVar fname <* resC "⇒" <|> unused fname
|
||||
t <- assert_total term fname <* needRes "]"
|
||||
pure (i, t)
|
||||
|
||||
||| box term `[t]` or type `[π.A]`
|
||||
export
|
||||
boxTerm : FileName -> Grammar True PTerm
|
||||
|
@ -287,6 +278,19 @@ termArg fname = withLoc fname $
|
|||
<|> [|V qname|]
|
||||
<|> const <$> tupleTerm fname
|
||||
|
||||
export
|
||||
properTypeLine : FileName -> Grammar True (PatVar, PTerm)
|
||||
properTypeLine fname = do
|
||||
resC "("
|
||||
i <- patVar fname <* resC "⇒" <|> unused fname
|
||||
t <- assert_total term fname <* needRes ")"
|
||||
pure (i, t)
|
||||
|
||||
export
|
||||
typeLine : FileName -> Grammar True (PatVar, PTerm)
|
||||
typeLine fname =
|
||||
properTypeLine fname <|> [|(,) (unused fname) (termArg fname)|]
|
||||
|
||||
||| optionally, two dimension arguments. if absent default to `@0 @1`
|
||||
private
|
||||
optDirection : FileName -> Grammar False (PDim, PDim)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue