on master help sign in
fix parsing of escaped quotes inside of strings
d2e1c8cHannes Mehnert
src/Idris/IdeSlave.hs+3−2
@@ -77,11 +77,12 @@ atomC = do string "True"; return (BoolAtom True)
77 <|> do string "False"; return (BoolAtom False)
77 <|> do string "False"; return (BoolAtom False)
78 <|> do xs <- many (noneOf " \n\t\r\"()"); return (SymbolAtom xs)
78 <|> do xs <- many (noneOf " \n\t\r\"()"); return (SymbolAtom xs)
79
79
80−quotedChar = noneOf "\""
80+quotedChar = try (string "\\\\" >> return '\\')
81 <|> try (string "\\\"" >> return '"')
81 <|> try (string "\\\"" >> return '"')
82+ <|> noneOf "\""
82
83
83parseSExp :: String -> Either ParseError SExp
84parseSExp :: String -> Either ParseError SExp
84−parseSExp input = parse pSExp "(unknown)" input
85+parseSExp = parse pSExp "(unknown)"
85
86
86data IdeSlaveCommand = REPLCompletions String
87data IdeSlaveCommand = REPLCompletions String
87 | Interpret String
88 | Interpret String