Stopped the Rain parser using any as a placeholder, and switched to using the unknown types
This commit is contained in:
parent
760c8a9a1e
commit
ec5baf4e97
|
@ -223,11 +223,13 @@ integerLiteral = do (val, i) <- integer
|
||||||
listLiteral :: RainParser A.Expression
|
listLiteral :: RainParser A.Expression
|
||||||
listLiteral
|
listLiteral
|
||||||
= try $ do m <- sLeftQ
|
= try $ do m <- sLeftQ
|
||||||
|
u <- getUniqueIdentifer
|
||||||
|
let t = A.List $ A.UnknownVarType (Right (m,u))
|
||||||
(do try sRightQ
|
(do try sRightQ
|
||||||
return $ A.Literal m (A.List A.Any) $ A.ListLiteral m []
|
return $ A.Literal m t $ A.ListLiteral m []
|
||||||
<|> do e0 <- try expression
|
<|> do e0 <- try expression
|
||||||
(do try sRightQ
|
(do try sRightQ
|
||||||
return $ A.Literal m (A.List A.Any) $
|
return $ A.Literal m t $
|
||||||
A.ListLiteral m [e0]
|
A.ListLiteral m [e0]
|
||||||
-- Up until the first comma, this may be a type declaration
|
-- Up until the first comma, this may be a type declaration
|
||||||
-- in a cast expression, so we "try" all the way
|
-- in a cast expression, so we "try" all the way
|
||||||
|
@ -235,7 +237,7 @@ listLiteral
|
||||||
<|> do try sComma
|
<|> do try sComma
|
||||||
es <- sepBy1 expression sComma
|
es <- sepBy1 expression sComma
|
||||||
sRightQ
|
sRightQ
|
||||||
return $ A.Literal m (A.List A.Any) $
|
return $ A.Literal m t $
|
||||||
A.ListLiteral m (e0 : es)
|
A.ListLiteral m (e0 : es)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -266,8 +268,10 @@ range = try $ do m <- sLeftQ
|
||||||
(A.List t)
|
(A.List t)
|
||||||
(A.Conversion mc A.DefaultConversion t begin)
|
(A.Conversion mc A.DefaultConversion t begin)
|
||||||
(A.Conversion mc A.DefaultConversion t end)
|
(A.Conversion mc A.DefaultConversion t end)
|
||||||
Nothing -> return $ A.ExprConstr m $ A.RangeConstr m
|
Nothing -> do u <- getUniqueIdentifer
|
||||||
(A.List A.Any) begin end
|
let t = A.List $ A.UnknownVarType (Right (m,u))
|
||||||
|
return $ A.ExprConstr m $ A.RangeConstr m
|
||||||
|
t begin end
|
||||||
|
|
||||||
expression :: RainParser A.Expression
|
expression :: RainParser A.Expression
|
||||||
expression
|
expression
|
||||||
|
|
Loading…
Reference in New Issue
Block a user