quote tags in printer when needed
This commit is contained in:
parent
be94422668
commit
f814b01c5c
3 changed files with 15 additions and 6 deletions
|
@ -115,15 +115,18 @@ prettyCase pi elim r ret arms = do
|
|||
arms <- prettyArms arms
|
||||
pure $ asep [caseD <++> elim, returnD <++> ret, ofD <++> arms]
|
||||
|
||||
-- [fixme] put delimiters around tags that aren't simple names
|
||||
export
|
||||
quoteTag : TagVal -> Doc HL
|
||||
quoteTag tag =
|
||||
if isName tag then fromString tag else hcat ["\"", fromString tag, "\""]
|
||||
|
||||
export
|
||||
prettyTag : TagVal -> Doc HL
|
||||
prettyTag t = hl Tag $ "'" <+> fromString t
|
||||
prettyTag t = hl Tag $ "'" <+> quoteTag t
|
||||
|
||||
-- [fixme] put delimiters around tags that aren't simple names
|
||||
export
|
||||
prettyTagBare : TagVal -> Doc HL
|
||||
prettyTagBare t = hl Tag $ fromString t
|
||||
prettyTagBare t = hl Tag $ quoteTag t
|
||||
|
||||
|
||||
parameters (showSubsts : Bool)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue