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

View file

@ -540,9 +540,6 @@ class Test03_Optimizer(UnitTestCase):
self.opt.optimize(p) self.opt.optimize(p)
out = self.outscript.output(p) out = self.outscript.output(p)
print out 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): def tearDown(self):
del self.parser del self.parser