-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #396 from polystat/fixDjangoAndTodo
support assign-6, assign-7
- Loading branch information
Showing
10 changed files
with
94 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
+package preface | ||
+alias xfakeclasses preface.xfakeclasses | ||
|
||
[from to step] > pyslice | ||
xfakeclasses.pySliceClass > x__class__ | ||
0 > force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
transpiler/src/main/scala/org/polystat/py2eo/transpiler/StarInCollectionConstructor.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package org.polystat.py2eo.transpiler | ||
|
||
import org.polystat.py2eo.parser.Expression.{CollectionCons, Star, T} | ||
|
||
object StarInCollectionConstructor { | ||
def apply(e : T) : T = e match { | ||
case CollectionCons(kind, l, ann) => | ||
val l1 = l.flatMap({ | ||
case Star(CollectionCons(kind1, l, _), _) => l | ||
case x : Any => List(x) | ||
}) | ||
CollectionCons(kind, l1, ann) | ||
case x : Any => x | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 0 additions & 62 deletions
62
...rg/polystat/py2eo/transpiler/simple-tests/compound-statements/class/inheritance-test.yaml
This file was deleted.
Oops, something went wrong.
11 changes: 3 additions & 8 deletions
11
...sources/org/polystat/py2eo/transpiler/simple-tests/simple-statements/assign/assign-6.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,10 @@ | ||
enabled: False | ||
enabled: True | ||
python: | | ||
def assignTest5(): | ||
def assignTest6(): | ||
class c: | ||
f = 1 | ||
a = [10, 11, 12, 13] | ||
(x, y) = [z, t] = c.f = a[0] = a[1] = 7, 8 | ||
a[2:1] = (7, 8) | ||
i, *[j, k], l = (21, 22, 23, 24) | ||
b1 = (x == 7) and (y == 8) and (z == 7) and (t == 8) and (c.f == (7, 8)) and a == [(7, 8), (7, 8), 7, 8, 12, 13] | ||
b2 = (i == 21) and (j == 22) and (k == 23) and (l == 24) | ||
return b1 and b2 | ||
assert assignTest5() | ||
return (x == 7) and (y == 8) and (z == 7) and (t == 8) and (c.f == (7, 8)) and a == [(7, 8), (7, 8), 7, 8, 12, 13] |
6 changes: 6 additions & 0 deletions
6
...sources/org/polystat/py2eo/transpiler/simple-tests/simple-statements/assign/assign-7.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
enabled: True | ||
python: | | ||
def assignTest7(): | ||
i, *[j, k], l = (21, 22, 23, 24) | ||
return (i == 21) and (j == 22) and (k == 23) and (l == 24) |
14ca009
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wasn't able to retrieve PDD puzzles from the code base and submit them to github. If you think that it's a bug on our side, please submit it to yegor256/0pdd:
Please, copy and paste this stack trace to GitHub: