Add DELETE_DEREF grammar rule

Fixes Issue #106
This commit is contained in:
rocky
2017-04-18 01:30:23 -04:00
parent 2665f292c5
commit cb6925beec
4 changed files with 15 additions and 2 deletions

Binary file not shown.

View File

@@ -0,0 +1,4 @@
def a():
del y
def b():
return y

View File

@@ -24,6 +24,9 @@ class Python32Parser(Python3Parser):
# JUMP_FORWARD in some cases, and hence we also don't
# see COME_FROM
_ifstmts_jump ::= c_stmts_opt
stmt ::= del_deref_stmt
del_deref_stmt ::= DELETE_DEREF
"""
pass

View File

@@ -204,11 +204,17 @@ class SourceWalker(GenericASTTraversal, object):
'raise_stmt2': ( '%|raise %c, %c\n', 0, 1),
})
else:
# Gotta love Python for its futzing around with syntax like this
TABLE_DIRECT.update({
'raise_stmt2': ( '%|raise %c from %c\n', 0, 1),
# Gotta love Python for its futzing around with syntax like this
'raise_stmt2': ( '%|raise %c from %c\n', 0, 1),
})
if version >= 3.2:
TABLE_DIRECT.update({
'del_deref_stmt': ( '%|del %c\n', 0),
'DELETE_DEREF': ( '%{pattr}', 0 ),
})
if version < 2.0:
TABLE_DIRECT.update({
'importlist': ( '%C', (0, maxint, ', ') ),