diff --git a/transpiler/src/main/scala/org/polystat/py2eo/transpiler/PrintLinearizedMutableEOWithCage.scala b/transpiler/src/main/scala/org/polystat/py2eo/transpiler/PrintLinearizedMutableEOWithCage.scala index 45ae9f305..d6ea1db2d 100644 --- a/transpiler/src/main/scala/org/polystat/py2eo/transpiler/PrintLinearizedMutableEOWithCage.scala +++ b/transpiler/src/main/scala/org/polystat/py2eo/transpiler/PrintLinearizedMutableEOWithCage.scala @@ -77,7 +77,7 @@ object PrintLinearizedMutableEOWithCage { case _ : ImportModule => List() case _ : ImportSymbol => List() case _ : ImportAllSymbols => List() - case ClassDef(name, bases, body, decorators, ann) if bases.length <= 1 && decorators.l.isEmpty => + case ClassDef(name, bases, body, decorators, ann) if decorators.l.isEmpty => val Suite(l0, _) = GenericStatementPasses.simpleProcStatement(GenericStatementPasses.unSuite)(body) val l = l0.filter{ case Pass(_) => false case _ => true } val init : Option[FuncDef] = l0 @@ -98,6 +98,7 @@ object PrintLinearizedMutableEOWithCage { name :: "[]" :: indent( "newUID.ap 0 > x__id__" :: + (init match { case None => "(goto (ap.@)).result > @" case Some(_) => "0 > nothing-here" }) :: "[x] > eq" :: " x__id__.eq (x.x__id__) > @" :: s"[$consArgs] > ap" :: diff --git a/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/class/multiple-inheritance.yaml b/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/class/multiple-inheritance.yaml index af1bd939c..5f6c19260 100644 --- a/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/class/multiple-inheritance.yaml +++ b/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/compound-statements/class/multiple-inheritance.yaml @@ -1,4 +1,4 @@ -enabled: False +enabled: True python: | def multiInh(): class c: diff --git a/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/expressions/attribute-reference/attribute-1.yaml b/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/expressions/attribute-reference/attribute-1.yaml deleted file mode 100644 index 60a9a5e8f..000000000 --- a/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/expressions/attribute-reference/attribute-1.yaml +++ /dev/null @@ -1,13 +0,0 @@ -enabled: False -python: | - def test(): - class emp: - def __init__(self): - self.name = 'xyz' - self.salary = 4000 - - def show(self): - print(self.name) - print(self.salary) - - return len(vars(emp())) == 2 \ No newline at end of file diff --git a/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/simple-statements/assign/assign-5.yaml b/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/simple-statements/assign/assign-5.yaml index 77a1f8864..6cc66f953 100644 --- a/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/simple-statements/assign/assign-5.yaml +++ b/transpiler/src/test/resources/org/polystat/py2eo/transpiler/simple-tests/simple-statements/assign/assign-5.yaml @@ -1,4 +1,4 @@ -enabled: False +enabled: True python: | def test7_2_1(): x = 0 @@ -8,7 +8,7 @@ python: | class c: attr = 1 c.attr += 1 - checkTargetC = c.attr == 1 + checkTargetC = c.attr == 2 a = [0, 1] a[0] += 1