Compare commits

..

1 commit

Author SHA1 Message Date
c4d59d3236
ref(lexer): rename MathsBracket -> MathMultiline 2025-09-24 21:35:21 +08:00
2 changed files with 5 additions and 5 deletions

View file

@ -53,8 +53,8 @@ data Token
| BracketClose
| MathInlineOpen
| MathInlineClose
| MathsMultilineOpen
| MathsMultilineClose
| MathMultilineOpen
| MathMultilineClose
| NumericEntity Int
| Module Text
| QuoteOpen
@ -243,7 +243,7 @@ labeledLink = do
]
mathMultiline :: Lexer
mathMultiline = delimited "\\[" "\\]" MathsMultilineOpen MathsMultilineClose
mathMultiline = delimited "\\[" "\\]" MathMultilineOpen MathMultilineClose
mathInline :: Lexer
mathInline = delimited "\\(" "\\)" MathInlineOpen MathInlineClose

View file

@ -93,9 +93,9 @@ anchors =
maths :: IO ()
maths = do
"\\[some math\\]"
`shouldLexTo` [ (1, 1, MathsMultilineOpen)
`shouldLexTo` [ (1, 1, MathMultilineOpen)
, (1, 3, Token "some math")
, (1, 12, MathsMultilineClose)
, (1, 12, MathMultilineClose)
]
"\\(other maths\\)"
`shouldLexTo` [ (1, 1, MathInlineOpen)