Permalink
Browse files

[BUG #5706] cleaned out old 'for' loop code

  • Loading branch information...
1 parent 01e9434 commit 5ba7f682e111a8e2dae57d6c17954c702d43fd4c @thron7 thron7 committed Mar 26, 2012
Showing with 0 additions and 72 deletions.
  1. +0 −72 tool/pylib/ecmascript/frontend/treegenerator.py
@@ -1303,78 +1303,6 @@ def std(self):
advance(',')
third.childappend(exprList)
-
- #if tokenStream.peek(2 if token.id=="var" else 1).id == "in":
- # self.set("forVariant", "in")
- # var_s = None
- # operation = symbol("in")(token.get("line"), token.get("column"))
- # operation.type = "operation"
- # operation.set("operator", "IN")
- # operation.set("value", "in")
- # self.childappend(operation)
- # op_first = symbol("first")(token.get("line"), token.get("column"))
- # operation.childappend(op_first)
- # if token.id == "var":
- # var_s = symbol("definitionList")(token.get("line"), token.get("column"))
- # op_first.childappend(var_s)
- # advance("var")
- # defn = symbol("definition")(token.get("line"), token.get("column"))
- # var_s.childappend(defn)
- # defn.childappend(expression(95)) # bind_left higher than "in"
- # else:
- # #ident = symbol("identifier")(token.get("line"), token.get("column"))
- # #op_first.childappend(ident)
- # #ident.set("value", token.get("value"))
- # #advance("identifier")
- # # !support: for(a[i++] in o)
- # op_first.childappend(expression())
- # advance("in")
- # op_second = symbol("second")(token.get("line"), token.get("column"))
- # operation.childappend(op_second)
- # op_second.childappend(expression())
- #
- ## for (;;) [mind: all three subexpressions are optional]
- #else:
- # self.set("forVariant", "iter")
- # condition = symbol("expressionList")(token.get("line"), token.get("column"))
- # self.childappend(condition)
- # # init part
- # first = symbol("first")(token.get("line"), token.get("column"))
- # condition.childappend(first)
- # if token.id == ";":
- # pass # empty part
- # else:
- # init_part = None
- # if token.id == "var":
- # t = token
- # advance()
- # init_part = t.std() # parse it like a 'var' stmt
- # else:
- # exprList = symbol("expressionList")(token.get("line"), token.get("column"))
- # init_part = exprList
- # lst = init_list()
- # for assgn in lst:
- # exprList.childappend(assgn)
- # first.childappend(init_part)
- # advance(";")
- # # condition part
- # second = symbol("second")(token.get("line"), token.get("column"))
- # condition.childappend(second)
- # if token.id != ";":
- # second.childappend(expression())
- # advance(";")
- # # update part
- # third = symbol("third")(token.get("line"), token.get("column"))
- # condition.childappend(third)
- # if token.id != ")":
- # exprList = symbol("expressionList")(token.get("line"), token.get("column"))
- # while token.id != ')':
- # expr = expression(0)
- # exprList.childappend(expr)
- # if token.id == ',':
- # advance(',')
- # third.childappend(exprList)
-
# body
advance(")")
body = symbol("body")(token.get("line"), token.get("column"))

0 comments on commit 5ba7f68

Please sign in to comment.