From 0b32ceadeace2e5650ecb5fe1daaebc571bb756d Mon Sep 17 00:00:00 2001 From: Iván Ávalos Date: Fri, 25 Nov 2022 18:27:22 -0600 Subject: ¡Expresiones if y while! MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- compilador/astree/expr.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'compilador/astree') 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 | -- cgit v1.2.3