From: Jean Privat Date: Thu, 18 Jun 2015 01:44:22 +0000 (-0400) Subject: ast: new class AEqFormExpr to factorize AEqExpr and ANeExpr X-Git-Tag: v0.7.6~21^2~6 X-Git-Url: http://nitlanguage.org?ds=inline ast: new class AEqFormExpr to factorize AEqExpr and ANeExpr Signed-off-by: Jean Privat --- diff --git a/src/parser/parser_nodes.nit b/src/parser/parser_nodes.nit index 9131c3e..5e24989 100644 --- a/src/parser/parser_nodes.nit +++ b/src/parser/parser_nodes.nit @@ -2094,15 +2094,22 @@ class ANotExpr var n_expr: AExpr is writable, noinit end +# A `==` or a `!=` expression +# +# Both have a similar effect on adaptive typing, so this class factorizes the common behavior. +class AEqFormExpr + super ABinopExpr +end + # A `==` expression class AEqExpr - super ABinopExpr + super AEqFormExpr redef fun operator do return "==" end # A `!=` expression class ANeExpr - super ABinopExpr + super AEqFormExpr redef fun operator do return "!=" end