ast: new class AEqFormExpr to factorize AEqExpr and ANeExpr
authorJean Privat <jean@pryen.org>
Thu, 18 Jun 2015 01:44:22 +0000 (21:44 -0400)
committerJean Privat <jean@pryen.org>
Thu, 18 Jun 2015 01:44:22 +0000 (21:44 -0400)
Signed-off-by: Jean Privat <jean@pryen.org>

src/parser/parser_nodes.nit

index 9131c3e..5e24989 100644 (file)
@@ -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