DEADSOFTWARE

Добавлен оператор IN
[dsw-obn.git] / src / oberon.c
index 50429645b22a713480253b1fb262128dc1b97af6..38e24a8da8b963669a406220cef798290e3b43ef 100644 (file)
@@ -1814,7 +1814,22 @@ oberon_make_bin_op(oberon_context_t * ctx, int token, oberon_expr_t * a, oberon_
        oberon_type_t * result;
 
        bool error = false;
-       if(token == IS)
+       if(token == IN)
+       {
+               if(a -> result -> class != OBERON_TYPE_INTEGER)
+               {
+                       oberon_error(ctx, "must be integer");
+               }
+
+               if(b -> result -> class != OBERON_TYPE_SET)
+               {
+                       oberon_error(ctx, "must be set");
+               }
+
+               result = ctx -> bool_type;
+               expr = oberon_new_operator(OP_IN, result, a, b);
+       }
+       else if(token == IS)
        {
                oberon_type_t * v = a -> result;
                if(v -> class == OBERON_TYPE_POINTER)