aboutsummaryrefslogtreecommitdiff
path: root/compilador/astree/expr.py
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2022-11-25 18:27:22 -0600
committerIván Ávalos <avalos@disroot.org>2022-11-25 18:27:22 -0600
commit0b32ceadeace2e5650ecb5fe1daaebc571bb756d (patch)
tree652805d15a865eea7e2c1047ab90c2903ff200d2 /compilador/astree/expr.py
parent4b78bc397a51456bd9d0bf08fbd6b1394b91c288 (diff)
downloadjavanol-0b32ceadeace2e5650ecb5fe1daaebc571bb756d.tar.gz
javanol-0b32ceadeace2e5650ecb5fe1daaebc571bb756d.tar.bz2
javanol-0b32ceadeace2e5650ecb5fe1daaebc571bb756d.zip
¡Expresiones if y while!
Diffstat (limited to 'compilador/astree/expr.py')
-rw-r--r--compilador/astree/expr.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/compilador/astree/expr.py b/compilador/astree/expr.py
index d5a2cb0..c074553 100644
--- a/compilador/astree/expr.py
+++ b/compilador/astree/expr.py
@@ -114,9 +114,17 @@ class ReadExpr:
# A return statement.
#
-# return a
+# retorna a
ReturnExpr = Optional[Expr]
+# A while expression.
+#
+# mientras (cond) { }
+@dataclass
+class WhileExpr:
+ cond: Expr
+ body: Expr
+
# A Javañol expression.
Expr = (AccessExpr | AssignExpr | BinarithmExpr | CallExpr |
ConstantExpr | ForExpr | IfExpr | CompoundExpr |