diff options
| author | Simon-Kor <52245124+Simon-Kor@users.noreply.github.com> | 2024-04-11 13:50:29 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-11 13:50:29 +0200 |
| commit | 1d5812e9600b38fa49a6e7cea2e425c7655fa7ef (patch) | |
| tree | bcbaf350be472bd0b36c8458ae066d65ed0c096d /source | |
| parent | 15deff4df111d86c84d808f1c9cc4e30013287d0 (diff) | |
| parent | 7a80b75aeaf7fd6e8828b843fa58664f11451833 (diff) | |
Merge pull request #1 from adelon/main
Update Fork
Diffstat (limited to 'source')
| -rw-r--r-- | source/Syntax/Token.hs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/source/Syntax/Token.hs b/source/Syntax/Token.hs index 7a9a42d..1d13693 100644 --- a/source/Syntax/Token.hs +++ b/source/Syntax/Token.hs @@ -27,7 +27,7 @@ import Base hiding (many) import Control.Monad.Combinators import Control.Monad.State.Strict -import Data.Char (isAsciiLower) +import Data.Char (isAsciiLower, isDigit) import Data.List.NonEmpty qualified as NonEmpty import Data.Text qualified as Text import Prettyprinter (Pretty(..)) @@ -392,7 +392,10 @@ ref = lexeme do _ -> Char.char '}' *> pure (Ref ms) marker :: Lexer Text -marker = takeWhile1P Nothing (\x -> isAsciiLower x || x == '_') +marker = do + c <- satisfy isAsciiLower + cs <- takeWhileP Nothing (\x -> isAsciiLower x || isDigit x || x == '_') + pure (Text.cons c cs) -- | Parses the end of an environment. -- Commits only after having seen "\end{". |
