diff options
| author | Simon-Kor <52245124+Simon-Kor@users.noreply.github.com> | 2024-09-17 00:36:24 +0200 |
|---|---|---|
| committer | Simon-Kor <52245124+Simon-Kor@users.noreply.github.com> | 2024-09-17 00:36:24 +0200 |
| commit | 5362771c14eccd80fd1a3ab6521c3a6ad9bb7838 (patch) | |
| tree | 4b64211436b5c5d7145cd552231591ed1c7e68f3 /source/Syntax/Token.hs | |
| parent | 3dca719ba8f9a59471f2c761cf8846cf597eae97 (diff) | |
Corrected Math Env Parsing
Since Latex has a really specify syntax for
\begin{cases} ... \end{cases}
The math mode in tokenizing had to be setup correctly.
Diffstat (limited to 'source/Syntax/Token.hs')
| -rw-r--r-- | source/Syntax/Token.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/Syntax/Token.hs b/source/Syntax/Token.hs index 52da86a..53e1e6a 100644 --- a/source/Syntax/Token.hs +++ b/source/Syntax/Token.hs @@ -189,7 +189,7 @@ toks = whitespace *> goNormal id <* eof Nothing -> pure (f []) Just t@Located{unLocated = BeginEnv "math"} -> goMath (f . (t:)) Just t@Located{unLocated = BeginEnv "align*"} -> goMath (f . (t:)) - Just t@Located{unLocated = BeginEnv "cases"} -> goMath (f . (t:)) + --Just t@Located{unLocated = BeginEnv "cases"} -> goMath (f . (t:)) Just t -> goNormal (f . (t:)) goText f = do r <- optional textToken @@ -205,7 +205,7 @@ toks = whitespace *> goNormal id <* eof Nothing -> pure (f []) Just t@Located{unLocated = EndEnv "math"} -> goNormal (f . (t:)) Just t@Located{unLocated = EndEnv "align*"} -> goNormal (f . (t:)) - Just t@Located{unLocated = EndEnv "cases"} -> goNormal (f . (t:)) + --Just t@Located{unLocated = EndEnv "cases"} -> goNormal (f . (t:)) Just t@Located{unLocated = BeginEnv "text"} -> goText (f . (t:)) Just t@Located{unLocated = BeginEnv "explanation"} -> goText (f . (t:)) Just t -> goMath (f . (t:)) @@ -282,7 +282,7 @@ alignBegin = guardM isTextMode *> lexeme do casesBegin :: Lexer (Located Token) casesBegin = guardM isTextMode *> lexeme do Char.string "\\begin{cases}" - setMathMode + --setMathMode pure (BeginEnv "cases") -- | Parses a single end math token. @@ -301,7 +301,7 @@ alignEnd = guardM isMathMode *> lexeme do casesEnd :: Lexer (Located Token) casesEnd = guardM isMathMode *> lexeme do Char.string "\\end{cases}" - setTextMode + --setTextMode pure (EndEnv "cases") |
