ref(lexer): rename MathsBracket -> MathsMultiline
This commit is contained in:
parent
6ec47dad04
commit
bd07547e26
2 changed files with 7 additions and 7 deletions
10
src/Lexer.hs
10
src/Lexer.hs
|
|
@ -53,8 +53,8 @@ data Token
|
||||||
| BracketClose
|
| BracketClose
|
||||||
| MathInlineOpen
|
| MathInlineOpen
|
||||||
| MathInlineClose
|
| MathInlineClose
|
||||||
| MathsBracketOpen
|
| MathsMultilineOpen
|
||||||
| MathsBracketClose
|
| MathsMultilineClose
|
||||||
| NumericEntity Int
|
| NumericEntity Int
|
||||||
| Module Text
|
| Module Text
|
||||||
| QuoteOpen
|
| QuoteOpen
|
||||||
|
|
@ -85,7 +85,7 @@ lexText = go
|
||||||
toks <-
|
toks <-
|
||||||
choice $
|
choice $
|
||||||
Parsec.try
|
Parsec.try
|
||||||
<$> [ mathsBracket
|
<$> [ mathMultiline
|
||||||
, mathInline
|
, mathInline
|
||||||
, escape -- maths go before escape to avoid mismatch
|
, escape -- maths go before escape to avoid mismatch
|
||||||
, headers
|
, headers
|
||||||
|
|
@ -242,8 +242,8 @@ labeledLink = do
|
||||||
, (pos8, LabeledLinkClose)
|
, (pos8, LabeledLinkClose)
|
||||||
]
|
]
|
||||||
|
|
||||||
mathsBracket :: Lexer
|
mathMultiline :: Lexer
|
||||||
mathsBracket = delimited "\\[" "\\]" MathsBracketOpen MathsBracketClose
|
mathMultiline = delimited "\\[" "\\]" MathsMultilineOpen MathsMultilineClose
|
||||||
|
|
||||||
mathInline :: Lexer
|
mathInline :: Lexer
|
||||||
mathInline = delimited "\\(" "\\)" MathInlineOpen MathInlineClose
|
mathInline = delimited "\\(" "\\)" MathInlineOpen MathInlineClose
|
||||||
|
|
|
||||||
|
|
@ -93,9 +93,9 @@ anchors =
|
||||||
maths :: IO ()
|
maths :: IO ()
|
||||||
maths = do
|
maths = do
|
||||||
"\\[some math\\]"
|
"\\[some math\\]"
|
||||||
`shouldLexTo` [ (1, 1, MathsBracketOpen)
|
`shouldLexTo` [ (1, 1, MathsMultilineOpen)
|
||||||
, (1, 3, Token "some math")
|
, (1, 3, Token "some math")
|
||||||
, (1, 12, MathsBracketClose)
|
, (1, 12, MathsMultilineClose)
|
||||||
]
|
]
|
||||||
"\\(other maths\\)"
|
"\\(other maths\\)"
|
||||||
`shouldLexTo` [ (1, 1, MathInlineOpen)
|
`shouldLexTo` [ (1, 1, MathInlineOpen)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue