From 40520f39195bc6dd0360a0833deefc71e943c8f9 Mon Sep 17 00:00:00 2001 From: Radon Rosborough Date: Tue, 12 May 2020 12:25:58 -0600 Subject: [PATCH] Work around regex-tdfa not handling newlines https://github.com/haskell-hvr/regex-tdfa/issues/11 --- src/Lexer.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Lexer.hs b/src/Lexer.hs index 210eb58..2285008 100644 --- a/src/Lexer.hs +++ b/src/Lexer.hs @@ -25,10 +25,10 @@ patterns = , ("\\]" , const $ Just RBRACKET) , ("[0-9]+|0[xX][0-9a-fA-F]+", Just . INTEGER . read) , ("[^" ++ nonSymbol ++ "0-9][^" ++ nonSymbol ++ "]*", Just . SYMBOL) - , ( "\"([^\\\\\"]|\\\\[\\\\\"0abfnrtv]|\\\\x[0-9a-zA-Z]{2})*\"" + , ( "\"([^\\\\\"]|\\\\[\\\\\"0abfnrtv]|\\\\x[0-9a-zA-Z]{2}|\n)*\"" , Just . STRING . readString ) - , ( "'([^\\\\\']|\\\\[\\\\\'0abfnrtv]|\\\\x[0-9a-zA-Z]{2})'" + , ( "'([^\\\\\']|\\\\[\\\\\'0abfnrtv]|\\\\x[0-9a-zA-Z]{2}|\n)'" , \s -> let s' = readString s in if length s' == 1