diff options
| author | Roman Smrž <roman.smrz@seznam.cz> | 2025-11-06 22:00:10 +0100 |
|---|---|---|
| committer | Roman Smrž <roman.smrz@seznam.cz> | 2025-11-06 22:00:10 +0100 |
| commit | 80bec33fe694f916eba96befdab63548077cdec5 (patch) | |
| tree | 6e17443f1e66c23929546f0924d5210beae51c2a /src | |
| parent | 6ee42f58d7293d810a5406d06020e1fdc9bcdaf0 (diff) | |
Diffstat (limited to 'src')
| -rw-r--r-- | src/Parser/Shell.hs | 7 |
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 |