replace '≔' and '·' with '=' and (only) '.'
This commit is contained in:
parent
1c53b63bdf
commit
f2272da4b4
6 changed files with 42 additions and 38 deletions
|
@ -183,7 +183,7 @@ reserved =
|
|||
Sym "×" `Or` Sym "**",
|
||||
Sym "≡" `Or` Sym "==",
|
||||
Sym "∷" `Or` Sym "::",
|
||||
Sym "·" `Or` Punc '.',
|
||||
Punc1 '.',
|
||||
Word1 "case",
|
||||
Word1 "case1",
|
||||
Word "caseω" `Or` Word "case#",
|
||||
|
@ -198,7 +198,7 @@ reserved =
|
|||
Word1 "def",
|
||||
Word1 "def0",
|
||||
Word "defω" `Or` Word "def#",
|
||||
Sym "≔" `Or` Sym ":=",
|
||||
Sym1 "=",
|
||||
Word1 "load",
|
||||
Word1 "namespace"]
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ qty = zeroOne Zero One
|
|||
|
||||
private covering
|
||||
qtys : Grammar False (List PQty)
|
||||
qtys = option [] [|toList $ some qty <* res "·"|]
|
||||
qtys = option [] [|toList $ some qty <* res "."|]
|
||||
|
||||
export
|
||||
dimConst : Grammar True DimConst
|
||||
|
@ -177,7 +177,7 @@ private covering
|
|||
caseIntro : Grammar True PQty
|
||||
caseIntro = resC "case1" $> One
|
||||
<|> resC "caseω" $> Any
|
||||
<|> resC "case" *> qty <* resC "·"
|
||||
<|> resC "case" *> qty <* resC "."
|
||||
|
||||
private
|
||||
optNameBinder : Grammar False BName
|
||||
|
@ -272,12 +272,12 @@ export covering
|
|||
defIntro : Grammar True PQty
|
||||
defIntro = Zero <$ resC "def0"
|
||||
<|> Any <$ resC "defω"
|
||||
<|> resC "def" *> option Any (qty <* resC "·")
|
||||
<|> resC "def" *> option Any (qty <* resC ".")
|
||||
|
||||
export covering
|
||||
definition : Grammar True PDefinition
|
||||
definition =
|
||||
[|MkPDef defIntro name (optional (resC ":" *> term)) (resC "≔" *> term)|]
|
||||
[|MkPDef defIntro name (optional (resC ":" *> term)) (resC "=" *> term)|]
|
||||
|
||||
export
|
||||
load : Grammar True String
|
||||
|
|
|
@ -15,16 +15,15 @@ commas [x] = [x]
|
|||
commas (x::xs) = (x <+> hl Delim ",") :: commas xs
|
||||
|
||||
private %inline
|
||||
blobD : Pretty.HasEnv m => m (Doc HL)
|
||||
blobD = hlF Delim $ ifUnicode "·" "%"
|
||||
dotD : Doc HL
|
||||
dotD = hl Delim "."
|
||||
|
||||
export %inline
|
||||
prettyQtyBinds : Pretty.HasEnv m => PrettyHL q => PrettyHL a =>
|
||||
List q -> a -> m (Doc HL)
|
||||
prettyQtyBinds [] x = pretty0M x
|
||||
prettyQtyBinds qtys x = pure $
|
||||
hang 2 $ sep [aseparate comma !(traverse pretty0M qtys) <++> !blobD,
|
||||
!(pretty0M x)]
|
||||
hcat [hseparate comma !(traverse pretty0M qtys), dotD, align !(pretty0M x)]
|
||||
|
||||
|
||||
public export
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue