aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Parser.hs
diff options
context:
space:
mode:
authorMarvin Borner2022-08-18 13:28:58 +0200
committerMarvin Borner2022-08-18 13:29:24 +0200
commit9148f5d2a82ac7784649bf8a75b4e9b6d87b6cea (patch)
treed9ac1ff0b06401a8206c1872378f23e93381048e /src/Parser.hs
parent266286d108b8304efc67d64f47c1ee9d8d4b17c9 (diff)
Reduced redundant testing
Diffstat (limited to 'src/Parser.hs')
-rw-r--r--src/Parser.hs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Parser.hs b/src/Parser.hs
index 1b3ac41..c23130d 100644
--- a/src/Parser.hs
+++ b/src/Parser.hs
@@ -101,7 +101,9 @@ parseString = do
parseChar :: Parser Expression
parseChar = do
ch <-
- between (char '\'') (char '\'') (satisfy (`notElem` "\"\\"))
+ between (char '\'')
+ (char '\'')
+ ((char '\\' *> specialEscape) <|> satisfy (`notElem` "\"\\"))
<?> "quoted char"
pure $ charToExpression ch