Skip to content

Commit

Permalink
Fix broken patterns arising from newline escape.
Browse files Browse the repository at this point in the history
  • Loading branch information
cdsmith committed Jun 21, 2017
1 parent 7ebd719 commit 083355d
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions codeworld-server/src/ErrorSanitizer.hs
Expand Up @@ -47,12 +47,12 @@ filterStages = [
(mkRegex "Couldn't match expected type Text\\s*with actual type GHC.Types.Char",
"Text requires double quotes, rather than single."),
(mkRegex "base-[0-9.]*:GHC\\.Stack\\.Types\\.HasCallStack => ", ""),
(mkRegex "When checking that:\\s*[^\\n]*\\s*is more polymorphic than:\\s*[^\\n]*(\\n\\s*)?",
(mkRegex "When checking that:\\s*[^\n]*\\s*is more polymorphic than:\\s*[^\n]*(\n\\s*)?",
""),
(mkRegex "\\[GHC\\.Types\\.Char\\] -> ", "\n"),
(mkRegex "base(-[0-9.]*)?\\:(.|\\n)*?->( |\\n)*", "\n"),
(mkRegex "integer-gmp(-[0-9\\.]*)?:(.|\\n)*?->( |\\n)*", ""),
(mkRegex "GHC\\.[A-Za-z.]*(\\s|\\n)*->( |\\n)*", ""),
(mkRegex "base(-[0-9.]*)?\\:(.|\n)*?->( |\n)*", "\n"),
(mkRegex "integer-gmp(-[0-9\\.]*)?:(.|\n)*?->( |\n)*", ""),
(mkRegex "GHC\\.[A-Za-z.]*(\\s|\n)*->( |\n)*", ""),
(mkRegex "at src/[A-Za-z0-9\\/.:]*", ""),
(mkRegex "\\[GHC\\.Types\\.Char\\]" ,""),
(mkRegex "codeworld-base[-.:_A-Za-z0-9]*", "the standard library"),
Expand All @@ -62,12 +62,12 @@ filterStages = [
(mkRegex "\\bBool\\b", "Truth"),
(mkRegex "IO \\(\\)", "Program"),
(mkRegex "IO [a-z][a-zA-Z0-9_]*", "Program"),
(mkRegex "[ ]*Perhaps you intended to use TemplateHaskell\\n", ""),
(mkRegex "imported from [^)\\n]*", "defined in the standard library"),
(mkRegex "[ ]*Perhaps you intended to use TemplateHaskell\n", ""),
(mkRegex "imported from [^)\n]*", "defined in the standard library"),
(mkRegex "\\(and originally defined in [^)]*\\)", "\n"),
(mkRegex "the first argument", "the parameter(s)"),
(mkRegex "[ ]*The function [a-zA-Z0-9_]* is applied to [a-z0-9]* arguments,\\n", ""),
(mkRegex "[ ]*but its type .* has only .*\\n", ""),
(mkRegex "[ ]*The function [a-zA-Z0-9_]* is applied to [a-z0-9]* arguments,\n", ""),
(mkRegex "[ ]*but its type .* has only .*\n", ""),
(mkRegex "A data constructor of that name is in scope; did you mean DataKinds\\?",
"That name refers to a value, not a type."),
(mkRegex "type constructor or class", "type"),
Expand All @@ -77,7 +77,7 @@ filterStages = [
(mkRegex "lexical error at character '\\\\822[01]'", "Smart quotes are not allowed."),
(mkRegex "Use -v to see a list of the files searched for\\.", ""),
(mkRegex "CallStack \\(from HasCallStack\\):", "When Evaluating:"),
(mkRegex "\\n\\s+\\n", "\n")
(mkRegex "\n\\s+\n", "\n")
]

filterOutput :: ByteString -> ByteString
Expand Down

0 comments on commit 083355d

Please sign in to comment.