Skip to content

Commit

Permalink
Keep bars as part of the token
Browse files Browse the repository at this point in the history
  • Loading branch information
LeventErkok committed Dec 4, 2024
1 parent 65507ff commit 00e0fbc
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Data/SBV/Utils/SExpr.hs
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,10 @@ tokenize inp = go inp []
go (':':cs) sofar = case break (`elem` stopper) cs of
(pre, rest) -> go rest ((':':pre) : sofar)

go ('|':r) sofar = case span (/= '|') r of
(pre, '|':rest) -> go rest (pre : sofar)
(pre, rest) -> go rest (pre : sofar)
go ('|':r) sofar = let wrap s = '|' : s ++ "|"
in case span (/= '|') r of
(pre, '|':rest) -> go rest (wrap pre : sofar)
(pre, rest) -> go rest (wrap pre : sofar)

go ('"':r) sofar = go rest (finalStr : sofar)
where grabString [] acc = (reverse acc, []) -- Strictly speaking, this is the unterminated string case; but let's ignore
Expand Down

0 comments on commit 00e0fbc

Please sign in to comment.