From 80bec33fe694f916eba96befdab63548077cdec5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roman=20Smr=C5=BE?= Date: Thu, 6 Nov 2025 22:00:10 +0100 Subject: Do not stop shell command parsing on some not-yet-used special chars --- src/Parser/Shell.hs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/Parser') 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 -- cgit v1.2.3