Struct members should take in pointer to self
This commit is contained in:
@@ -148,7 +148,7 @@ memberFuncP = do
|
|||||||
args <- parens (sepBy (Bind <$> identifier <* symbol ":" <*> typeP) (symbol ","))
|
args <- parens (sepBy (Bind <$> identifier <* symbol ":" <*> typeP) (symbol ","))
|
||||||
retType <- (symbol "->" *> typeP) <|> pure VoidType
|
retType <- (symbol "->" *> typeP) <|> pure VoidType
|
||||||
body <- braces (many stmtP)
|
body <- braces (many stmtP)
|
||||||
return $ Func name (Bind "self" self : args) retType body
|
return $ Func name (Bind "self" (PtrType self) : args) retType body
|
||||||
|
|
||||||
organize :: [TL] -> Program
|
organize :: [TL] -> Program
|
||||||
organize tls = Program structs enums funcs
|
organize tls = Program structs enums funcs
|
||||||
|
|||||||
Reference in New Issue
Block a user