aboutsummaryrefslogtreecommitdiff
path: root/compilador/parse/decl.py
diff options
context:
space:
mode:
Diffstat (limited to 'compilador/parse/decl.py')
-rw-r--r--compilador/parse/decl.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/compilador/parse/decl.py b/compilador/parse/decl.py
index 93666fc..aa9e23a 100644
--- a/compilador/parse/decl.py
+++ b/compilador/parse/decl.py
@@ -58,9 +58,13 @@ class ParseDecl:
if type(proto) is Error:
return proto
+ init = ParseExpr(self.parser).compound_expr()
+ if type(init) is Error:
+ return init
+
return DeclFunc(ident = ident,
prototype = proto,
- body = None)
+ body = init)
# Parses a declaration.
def decl(self) -> (Decl | Error):