tools/pas2c.hs
changeset 7057 c3eba84d1a98
parent 7056 2884c7be6691
child 7060 861d6897917f
--- a/tools/pas2c.hs	Fri May 11 22:17:39 2012 +0400
+++ b/tools/pas2c.hs	Fri May 11 22:35:09 2012 +0400
@@ -685,6 +685,12 @@
             -- aw, "LongInt" here is hwengine-specific hack
             i <- op2CTyped op [SimpleType (Identifier t1 undefined), SimpleType (Identifier "LongInt" undefined)]
             ref2C $ FunCall [expr1, expr2] (SimpleReference i)
+        ("in", _, _) -> 
+            case expr2 of
+                 SetExpression set -> do
+                     ids <- mapM (id2C IOLookup) set
+                     return . parens . hcat . punctuate (text " || ") . map (\i -> parens $ e1 <+> text "==" <+> i) $ ids
+                 _ -> error "'in' against not set expression"
         (o, _, _) | o `elem` boolOps -> do
                         modify(\s -> s{lastType = BTBool})
                         return $ parens e1 <+> text o <+> parens e2