rc #13
@@ -132,12 +132,10 @@ infixOp :: Parser Name
|
|||||||
infixOp = symvar <|> symcon <?> "operator"
|
infixOp = symvar <|> symcon <?> "operator"
|
||||||
|
|
||||||
symvar :: Parser Name
|
symvar :: Parser Name
|
||||||
symvar = T.pack <$>
|
symvar = T.cons <$> satisfy isVarSym <*> takeWhileP Nothing isSym
|
||||||
liftA2 (:) (satisfy isVarSym) (many $ satisfy isSym)
|
|
||||||
|
|
||||||
symcon :: Parser Name
|
symcon :: Parser Name
|
||||||
symcon = T.pack <$>
|
symcon = T.cons <$> char ':' <*> takeWhileP Nothing isSym
|
||||||
liftA2 (:) (char ':') (many $ satisfy isSym)
|
|
||||||
|
|
||||||
pat1 :: (OnFold) => Parser Pat'
|
pat1 :: (OnFold) => Parser Pat'
|
||||||
pat1 = VarP <$> flexeme varid
|
pat1 = VarP <$> flexeme varid
|
||||||
@@ -149,9 +147,7 @@ conid = NameCon <$> lexeme namecon
|
|||||||
<?> "constructor identifier"
|
<?> "constructor identifier"
|
||||||
|
|
||||||
namecon :: Parser Name
|
namecon :: Parser Name
|
||||||
namecon = T.pack <$>
|
namecon = T.cons <$> satisfy isUpper <*> takeWhileP Nothing isNameTail
|
||||||
liftA2 (:) (satisfy isUpper)
|
|
||||||
(many $ satisfy isNameTail)
|
|
||||||
|
|
||||||
varid :: Parser VarId
|
varid :: Parser VarId
|
||||||
varid = NameVar <$> try (lexeme namevar)
|
varid = NameVar <$> try (lexeme namevar)
|
||||||
@@ -170,8 +166,8 @@ decls = do
|
|||||||
namevar :: Parser Name
|
namevar :: Parser Name
|
||||||
namevar = word
|
namevar = word
|
||||||
& withPredicate (`notElem` keywords) empty
|
& withPredicate (`notElem` keywords) empty
|
||||||
where word = T.pack <$>
|
where
|
||||||
liftA2 (:) (satisfy isLower) (many $ satisfy isNameTail)
|
word = T.cons <$> satisfy isLower <*> takeWhileP Nothing isNameTail
|
||||||
|
|
||||||
keywords :: (IsString a) => [a]
|
keywords :: (IsString a) => [a]
|
||||||
keywords =
|
keywords =
|
||||||
|
|||||||
Reference in New Issue
Block a user