Commit 9f2fc80c authored by Bastian Kauschke's avatar Bastian Kauschke
Browse files

allow names starting with digits

parent 22c05629
......@@ -131,18 +131,10 @@ dot = character '.'
{-# INLINE dot #-}
name :: MonadParser m => m Text
name = lexeme ((T.append <$> nameChar1 <*> restName) <?> "name")
{-# INLINE name #-}
nameChar1 :: MonadParser m => m Text
nameChar1 = takeWhile1P Nothing (\c -> c == '_' || isLetter c)
{-# INLINE nameChar1 #-}
restName :: MonadParser m => m Text
restName = takeWhileP Nothing isNameChar
name = lexeme (takeWhile1P Nothing isNameChar <?> "name")
where
isNameChar c = c == '_' || isLetter c || isDigit c
{-# INLINE restName #-}
{-# INLINE name #-}
decimal :: (MonadParser m) => m Int
decimal = lexeme (mkNum <$> takeWhile1P (Just "digit") isDigit)
......
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