From 3f6f28012496e512e1dddfc50cdead740c64efce Mon Sep 17 00:00:00 2001 From: dours Date: Mon, 8 Nov 2021 17:23:43 +0200 Subject: [PATCH] workaround: i, x, msg should not be used in .eo code (and in .py code until #11 is resolved) --- python/python3/Java/SimplePass.scala | 3 ++- python/python3/test/trivial.py | 6 +++--- python/python3/test/trivialWithBreak.py | 8 ++++---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/python/python3/Java/SimplePass.scala b/python/python3/Java/SimplePass.scala index c8c379200..421fc2538 100644 --- a/python/python3/Java/SimplePass.scala +++ b/python/python3/Java/SimplePass.scala @@ -6,7 +6,8 @@ object SimplePass { case class Names(used : HashMap[String, Int]) { - def this() = this(HashMap()) + // the names mentioned here are incompatible with EO (see issue #416 in github.com/cqfn/eo) + def this() = this(HashMap("x" -> 1, "i" -> 1, "msg" -> 1, "txt" -> 1)) def last(s : String) : String = s + (used(s) - 1) diff --git a/python/python3/test/trivial.py b/python/python3/test/trivial.py index 861ccce5b..29901eef5 100644 --- a/python/python3/test/trivial.py +++ b/python/python3/test/trivial.py @@ -2,10 +2,10 @@ def testFib1(): f0 = 0 f1 = 1 - i = 0 - while (i < 10): + ii = 0 + while (ii < 10): f2 = f0 + f1 - i = i + 1 + ii = ii + 1 f0 = f1 f1 = f2 return 55 == f0 diff --git a/python/python3/test/trivialWithBreak.py b/python/python3/test/trivialWithBreak.py index c5bbfa008..220de1bbc 100644 --- a/python/python3/test/trivialWithBreak.py +++ b/python/python3/test/trivialWithBreak.py @@ -2,13 +2,13 @@ def testFib1(): f0 = 0 f1 = 1 - i = 0 - while (i < 10): + ii = 0 + while (ii < 10): f2 = f0 + f1 - i = i + 1 + ii = ii + 1 f0 = f1 f1 = f2 - if i == 9: break + if ii == 9: break print(f0) return (34 == f0)