Skip to content

Commit

Permalink
Work around regex-tdfa not handling newlines
Browse files Browse the repository at this point in the history
  • Loading branch information
raxod502 committed May 12, 2020
1 parent c0bda83 commit 40520f3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Lexer.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 40520f3

Please sign in to comment.