Small changes

This commit is contained in:
rocky
2016-09-18 17:23:49 -04:00
parent b02754c954
commit c119965d96
3 changed files with 3 additions and 1 deletions

View File

@@ -131,6 +131,7 @@ class Scanner2(scan.Scanner):
replace = {}
while i < n-1:
if self.lines[last_stmt].next > i:
# Distinguish "print ..." from "print ...,"
if self.code[last_stmt] == self.opc.PRINT_ITEM:
if self.code[i] == self.opc.PRINT_ITEM:
replace[i] = 'PRINT_ITEM_CONT'

View File

@@ -153,6 +153,7 @@ class Scanner26(scan.Scanner2):
replace = {}
while i < codelen - 1:
if self.lines[last_stmt].next > i:
# Distinguish "print ..." from "print ...,"
if self.code[last_stmt] == self.opc.PRINT_ITEM:
if self.code[i] == self.opc.PRINT_ITEM:
replace[i] = 'PRINT_ITEM_CONT'

View File

@@ -262,7 +262,7 @@ TABLE_DIRECT = {
'assert_expr_or': ( '%c or %c', 0, 2 ),
'assert_expr_and': ( '%c and %c', 0, 2 ),
'print_items_stmt': ( '%|print %c%c,\n', 0, 2),
'print_items_stmt': ( '%|print %c%c,\n', 0, 2), # Python 2 only
'print_items_nl_stmt': ( '%|print %c%c\n', 0, 2),
'print_item': ( ', %c', 0),
'print_nl': ( '%|print\n', ),