summaryrefslogtreecommitdiff
path: root/source/Syntax/Token.hs
diff options
context:
space:
mode:
Diffstat (limited to 'source/Syntax/Token.hs')
-rw-r--r--source/Syntax/Token.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/source/Syntax/Token.hs b/source/Syntax/Token.hs
index 408b374..5dfed65 100644
--- a/source/Syntax/Token.hs
+++ b/source/Syntax/Token.hs
@@ -354,7 +354,7 @@ beginToplevelEnvironment = lexeme do
-- | Parses tokens, switching tokenizing frames when encountering math and text environments.
environment :: Lexer [Located Token]
environment = do
- env <- skipManyTill anySingle beginToplevelEnvironment
+ env <- skipManyTill (comment <|> void anySingle) beginToplevelEnvironment
lts <- go (unLocated env) id
pure ((BeginEnv <$> env) : lts)
where