Check delimiters by hand to keep accurate source pos

This commit is contained in:
Igor Ranieri 2025-09-21 12:34:30 +02:00
parent 7ef411b134
commit 4ef8d2c28c
2 changed files with 15 additions and 10 deletions

View file

@ -41,13 +41,13 @@ maths :: IO ()
maths = do
"\\[some math\\]"
`shouldLexTo` [ (1, 1, MathsBracketOpen)
, (1, 2, Token "some math")
, (1, 13, MathsBracketClose)
, (1, 3, Token "some math")
, (1, 12, MathsBracketClose)
]
"\\(other maths\\)"
`shouldLexTo` [ (1, 1, MathsParenOpen)
, (1, 2, Token "other maths")
, (1, 15, MathsParenClose)
, (1, 3, Token "other maths")
, (1, 14, MathsParenClose)
]
escaping :: Expectation
@ -74,7 +74,7 @@ birdTracks :: Expectation
birdTracks =
">> code"
`shouldLexTo` [ (1, 1, BirdTrack)
, (1, 2, Token "code")
, (1, 4, Token "code")
]
quotes :: Expectation