Commit 4c51fd56 authored by Hans-Peter Deifel's avatar Hans-Peter Deifel
Browse files

Improve speed of name parser

parent 5b4b943c
......@@ -72,11 +72,11 @@ dot = symbol "."
{-# INLINE dot #-}
name :: MonadParser m => m Text
name = lexeme ((T.cons <$> nameChar1 <*> restName) <?> "name")
name = lexeme ((T.append <$> nameChar1 <*> restName) <?> "name")
{-# INLINE name #-}
nameChar1 :: MonadParser m => m Char
nameChar1 = letterChar <|> char '_'
nameChar1 :: MonadParser m => m Text
nameChar1 = takeWhile1P Nothing (\c -> c == '_' || isLetter c)
{-# INLINE nameChar1 #-}
restName :: MonadParser m => m Text
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment