Python 3 genexpr bug

This commit is contained in:
rocky
2016-05-15 20:59:28 -04:00
parent 007328b353
commit b5eaa9445d
5 changed files with 23 additions and 3 deletions

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,10 @@
# Bug in Python 3.5.1 calendar.py
# expr ::= LOAD_NAME
# get_iter ::= expr GET_ITER
# expr ::= get_iter
# genexpr ::= LOAD_GENEXPR LOAD_CONST MAKE_FUNCTION_0 expr GET_ITER CALL_FUNCTION_1
# expr ::= genexpr
names = (formatmonthname(False)
for k in __file__)

View File

@@ -0,0 +1,11 @@
# From Python 3.4 calendar
# load_closure ::= LOAD_CLOSURE
# load_closure ::= load_closure LOAD_CLOSURE
# expr ::= LOAD_GLOBAL
# get_iter ::= expr GET_ITER
# genexpr ::= load_closure LOAD_GENEXPR LOAD_CONST MAKE_CLOSURE_0 expr GET_ITER CALL_FUNCTION_
def formatyear(self, theyear, m=3):
for (i, row) in enumerate(self.yeardays2calendar(theyear, m)):
names = (self.formatmonthname(theyear, k, colwidth, False)
for k in months)

View File

@@ -358,11 +358,10 @@ class Python3Parser(PythonParser):
'''
load_genexpr ::= LOAD_GENEXPR
load_genexpr ::= BUILD_TUPLE_1 LOAD_GENEXPR LOAD_CONST
'''
def p_genexpr2(self, args):
'''
# Is there something general going on here?
genexpr ::= LOAD_GENEXPR LOAD_CONST MAKE_FUNCTION_0 expr GET_ITER CALL_FUNCTION_1
genexpr ::= load_closure LOAD_GENEXPR LOAD_CONST MAKE_CLOSURE_0 expr GET_ITER CALL_FUNCTION_1
'''
def p_expr3(self, args):