quote names in Show

This commit is contained in:
rhiannon morris 2023-05-25 18:34:13 +02:00
parent a11bedd62a
commit 00e79d4264
2 changed files with 5 additions and 3 deletions

View File

@ -31,7 +31,7 @@ baseStr (UN x) = x
baseStr (MN x i) = "\{x}#\{show i}" baseStr (MN x i) = "\{x}#\{show i}"
baseStr Unused = "_" baseStr Unused = "_"
export Show BaseName where show = baseStr export Show BaseName where show = show . baseStr
export FromString BaseName where fromString = UN export FromString BaseName where fromString = UN
@ -82,7 +82,8 @@ fromPBaseName = MakeName [<] . UN
export export
Show PName where Show PName where
show (MakePName mods base) = concat $ intersperse "." $ toList $ mods :< base show (MakePName mods base) =
show $ concat $ intersperse "." $ toList $ mods :< base
export Show Name where show = show . toPName export Show Name where show = show . toPName

View File

@ -89,7 +89,8 @@ terminalMatch what l r = terminalMatchN_ what [(l, r)]
||| tag without leading `'` ||| tag without leading `'`
export export
bareTag : Grammar True TagVal bareTag : Grammar True TagVal
bareTag = terminalMatchN "bare tag" [(`(Name t), `(show t)), (`(Str s), `(s))] bareTag = terminalMatchN "bare tag"
[(`(Name t), `(toDotsP t)), (`(Str s), `(s))]
||| tag with leading quote ||| tag with leading quote
export export