summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Parser/Expr.hs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/Parser/Expr.hs b/src/Parser/Expr.hs
index a228ad0..835c58d 100644
--- a/src/Parser/Expr.hs
+++ b/src/Parser/Expr.hs
@@ -34,11 +34,14 @@ import Parser.Core
import Test
identifier :: TestParser Text
-identifier = do
- lexeme $ TL.toStrict <$> takeWhile1P Nothing (\x -> isAlphaNum x || x == '_')
+identifier = label "identifier" $ do
+ lexeme $ do
+ lead <- lowerChar
+ rest <- takeWhileP Nothing (\x -> isAlphaNum x || x == '_')
+ return $ TL.toStrict $ TL.fromChunks $ (T.singleton lead :) $ TL.toChunks rest
varName :: TestParser VarName
-varName = VarName <$> identifier
+varName = label "variable name" $ VarName <$> identifier
newVarName :: forall a. ExprType a => TestParser (TypedVarName a)
newVarName = do