replace '≔' and '·' with '=' and (only) '.'

This commit is contained in:
rhiannon morris 2023-03-17 21:54:09 +01:00
parent 1c53b63bdf
commit f2272da4b4
6 changed files with 42 additions and 38 deletions

View file

@ -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"]

View file

@ -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

View file

@ -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