Skip to content

Commit

Permalink
fix(eo-phi-normalizer): correctly handle empty parentheses
Browse files Browse the repository at this point in the history
  • Loading branch information
deemp committed Nov 28, 2024
1 parent 0642f62 commit 4e1483d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion eo-phi-normalizer/src/Language/EO/Phi/Syntax.hs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ render d = rend 0 False (map ($ "") $ d []) ""
ShowS
rend i p = \case
"[" : "]" : ts -> showString "[]" . rend i False ts
"(" : ")" : ts -> showString "()" . rend i False ts
"(" : ")" : (t : ts) ->
(pending . showString "()")
. ( case t of
"," -> showChar ',' . new i ts
_ -> rend i False (t : ts)
)
"" : "" : ts -> showString "⟦ ⟧" . rend i False ts
"[" : ts -> char '[' . rend i False ts
"(" : ts -> char '(' . new (i + 1) ts
Expand Down

0 comments on commit 4e1483d

Please sign in to comment.