[Shell-escape] 'ascii-escape ' prefix toggle

This commit is contained in:
Nikolay Yakimov
2015-12-30 21:11:39 +03:00
parent d49d4cf2ea
commit 849496c047
2 changed files with 12 additions and 4 deletions

View File

@@ -16,6 +16,7 @@
module GHCMod.Options.ShellParse (parseCmdLine) where
import Data.Char
import Data.List
go :: String -> String -> [String] -> Bool -> [String]
-- result
@@ -36,6 +37,8 @@ go (c:cl) curarg accargs quotes
| otherwise = go cl (c:curarg) accargs quotes
parseCmdLine :: String -> [String]
parseCmdLine ('\\':comline) = go comline [] [] False
parseCmdLine comline'
| Just comline <- stripPrefix "ascii-escape " $ dropWhile isSpace comline'
= go (dropWhile isSpace comline) [] [] False
parseCmdLine [] = [""]
parseCmdLine comline = words comline