Skip to content

Commit

Permalink
workaround: i, x, msg should not be used in .eo code (and in .py code…
Browse files Browse the repository at this point in the history
… until #11 is resolved)
  • Loading branch information
dours committed Nov 8, 2021
1 parent 6783fd1 commit 3f6f280
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
3 changes: 2 additions & 1 deletion python/python3/Java/SimplePass.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
6 changes: 3 additions & 3 deletions python/python3/test/trivial.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions python/python3/test/trivialWithBreak.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 3f6f280

Please sign in to comment.