summaryrefslogtreecommitdiff
path: root/src/Parser
diff options
context:
space:
mode:
authorRoman Smrž <roman.smrz@seznam.cz>2025-11-06 22:00:10 +0100
committerRoman Smrž <roman.smrz@seznam.cz>2025-11-06 22:00:10 +0100
commit80bec33fe694f916eba96befdab63548077cdec5 (patch)
tree6e17443f1e66c23929546f0924d5210beae51c2a /src/Parser
parent6ee42f58d7293d810a5406d06020e1fdc9bcdaf0 (diff)
Do not stop shell command parsing on some not-yet-used special charsHEADmaster
Diffstat (limited to 'src/Parser')
-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