refactor lexer #2
2 changed files with 6 additions and 2 deletions
|
|
@ -152,7 +152,7 @@ delimitedSymmetric :: Parser a -> Token -> Token -> Parser [LocatedToken]
|
|||
delimitedSymmetric s t1 t2 = delimited s s t1 t2
|
||||
|
||||
eol :: Parser ()
|
||||
eol = void "\n" <|> Parsec.eof
|
||||
eol = void "\n" <|> void "\r\n" <|> Parsec.eof
|
||||
|
||||
header1 :: Lexer
|
||||
header1 = delimitedMaybe (void $ "= ") eol (Header One) Nothing
|
||||
|
|
|
|||
|
|
@ -107,11 +107,15 @@ maths = do
|
|||
]
|
||||
|
||||
escaping :: Expectation
|
||||
escaping =
|
||||
escaping = do
|
||||
"\\("
|
||||
`shouldLexTo` [ (1, 1, Escape)
|
||||
, (1, 2, Token "(")
|
||||
]
|
||||
"\\(\r\n"
|
||||
`shouldLexTo` [ (1, 1, Escape)
|
||||
, (1, 2, Token "(")
|
||||
]
|
||||
|
||||
unicode :: Expectation
|
||||
unicode =
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue