summaryrefslogtreecommitdiff
path: root/src/Parser/Shell.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Parser/Shell.hs')
-rw-r--r--src/Parser/Shell.hs7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/Parser/Shell.hs b/src/Parser/Shell.hs
index b575842..105edfa 100644
--- a/src/Parser/Shell.hs
+++ b/src/Parser/Shell.hs
@@ -29,7 +29,7 @@ parseTextArgument = lexeme $ fmap (App AnnNone (Pure T.concat) <$> foldr (liftA2
, unquotedString
]
where
- specialChars = [ '"', '\'', '\\', '$', '#', '|', '>', '<', ';', '[', ']', '{', '}', '(', ')', '*', '?', '~', '&', '!' ]
+ specialChars = [ '"', '\'', '\\', '$', '#', '|', '>', '<', ';', '[', ']'{-, '{', '}' -}, '(', ')'{-, '*', '?', '~', '&', '!' -} ]
stringSpecialChars = [ '"', '\\', '$' ]
@@ -66,10 +66,7 @@ parseTextArgument = lexeme $ fmap (App AnnNone (Pure T.concat) <$> foldr (liftA2
standaloneEscapedChar :: TestParser (Expr Text)
standaloneEscapedChar = do
void $ char '\\'
- fmap Pure $ choice $
- map (\c -> char c >> return (T.singleton c)) specialChars ++
- [ char ' ' >> return " "
- ]
+ fmap T.singleton . Pure <$> printChar
parseRedirection :: TestParser (Expr ShellArgument)
parseRedirection = choice