diff options
author | Iván Ávalos <avalos@disroot.org> | 2022-11-25 16:33:08 -0600 |
---|---|---|
committer | Iván Ávalos <avalos@disroot.org> | 2022-11-25 16:33:08 -0600 |
commit | c7f014aef2c86d7a17f2642180732a6ba9b2a125 (patch) | |
tree | d3439be25bf3ef025abb67144fc9c2fe1114530b /compilador/parse/decl.py | |
parent | 43ca3b1370fcb9e7cb8c3126ebf4e6ed7833fc13 (diff) | |
download | javanol-c7f014aef2c86d7a17f2642180732a6ba9b2a125.tar.gz javanol-c7f014aef2c86d7a17f2642180732a6ba9b2a125.tar.bz2 javanol-c7f014aef2c86d7a17f2642180732a6ba9b2a125.zip |
¡Ya hay funciones y (algunas) expresiones!
Diffstat (limited to 'compilador/parse/decl.py')
-rw-r--r-- | compilador/parse/decl.py | 6 |
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): |