Compare commits

..

1 commit

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

View file

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

View file

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