diff options
Diffstat (limited to 'src/Parser')
-rw-r--r-- | src/Parser/Shell.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/Parser/Shell.hs b/src/Parser/Shell.hs index 0f34fee..a61352d 100644 --- a/src/Parser/Shell.hs +++ b/src/Parser/Shell.hs @@ -22,6 +22,7 @@ import Script.Shell parseArgument :: TestParser (Expr Text) parseArgument = lexeme $ fmap (App AnnNone (Pure T.concat) <$> foldr (liftA2 (:)) (Pure [])) $ some $ choice [ doubleQuotedString + , singleQuotedString , escapedChar , stringExpansion , unquotedString @@ -44,6 +45,10 @@ parseArgument = lexeme $ fmap (App AnnNone (Pure T.concat) <$> foldr (liftA2 (:) ] App AnnNone (Pure T.concat) . foldr (liftA2 (:)) (Pure []) <$> inner + singleQuotedString :: TestParser (Expr Text) + singleQuotedString = do + Pure . TL.toStrict <$> (char '\'' *> takeWhileP Nothing (/= '\'') <* char '\'') + escapedChar :: TestParser (Expr Text) escapedChar = do void $ char '\\' |