Fix some comments

This commit is contained in:
Sei Lisa 2019-01-02 00:38:44 +01:00
parent f243f3a3c1
commit 42750c56d7
2 changed files with 3 additions and 8 deletions

View file

@ -1784,7 +1784,6 @@ class foldconst(object):
# If type(X) != Key, then:
# if (X) ; else {stuff} -> if (!X) {stuff}
# (being careful with labels again)
if child[0].t != 'key':
# We've already converted all other types to equivalent
# comparisons
@ -1849,10 +1848,9 @@ class foldconst(object):
if child[1].nt == 'CONST':
# FOR is delicate. It can have multiple expressions at start.
# And if there is more than one, these expressions will need a
# new block, which means new scope, which is dangerous.
# They are expressions, no declarations or labels allowed, thus
# no new identifiers may be created in the new scope, but it
# still feels dodgy.
# new block, which means new scope. They are expressions, no
# declarations or labels allowed, thus no new identifiers may
# be created in the new scope.
if lslfuncs.cond(child[1].value):
# Endless loop. Traverse the loop and the iterator.
self.FoldTree(child, 3)

View file

@ -540,9 +540,6 @@ class Test03_Optimizer(UnitTestCase):
self.opt.optimize(p)
out = self.outscript.output(p)
print out
# FIXME: DCR produces invalid code, thinks the while can be eliminated
# due to the jump jumping past it. Extremely corner case, but maybe
# worth a fix.
def tearDown(self):
del self.parser