Skip to content

Commit 7f2ed86

Browse files
committed
Test a few more features
1 parent a0963db commit 7f2ed86

3 files changed

Lines changed: 11 additions & 0 deletions

File tree

pxtpy/converter.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ namespace pxt.py {
1414
let ctx: Ctx
1515
let currIteration = 0
1616
let typeId = 0
17+
// this measures if we gained additional information about type state
18+
// we run conversion several times, until we have all information possible
1719
let numUnifies = 0
1820
let currErrs = ""
1921
let autoImport = true
@@ -1414,6 +1416,7 @@ namespace pxt.py {
14141416
if (!formals) {
14151417
if (fun)
14161418
error(n, U.lf("calling non-function"))
1419+
allargs = orderedArgs.map(expr)
14171420
} else {
14181421
if (orderedArgs.length > formals.length)
14191422
error(n, U.lf("too many arguments in call to '{0}'", fun.qName))

pxtpy/parser.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@ namespace pxt.py {
248248
let r = mkAST("For") as For
249249
expectKw("for")
250250
r.target = exprlist()
251+
setStoreCtx(r.target)
251252
expectKw("in")
252253
r.iter = testlist()
253254
r.body = colon_suite()
@@ -958,6 +959,7 @@ namespace pxt.py {
958959
rr.push(r)
959960
expectKw("for")
960961
r.target = exprlist()
962+
setStoreCtx(r.target)
961963
expectKw("in")
962964
r.iter = or_test()
963965
r.ifs = []

tests/python/game.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ def qux2(self):
33
z = 12
44
x = z * 3
55
self.baz = x
6+
for q in range(10):
7+
x += q
8+
lst = ["foo", "bar", "baz"]
9+
lst = lst[1:2]
10+
# TODO change to len(lst)
11+
assert lst.length == 2, 201
612
def qux(self):
713
self.baz = self.bar
814
self.blah = "hello"

0 commit comments

Comments
 (0)