# if the line still does not respect the rule
if not rules[i][0](line):
# this is a rule disgression
- print "## Disgression: ", rules[i][2], " in:", oldline
+ print ("## Disgression: ", rules[i][2], " in:", oldline)
else:
# just remind user about his/her errors
- print "## Reminder: ", rules[i][2], " in :", oldline
+ print ("## Reminder: ", rules[i][2], " in :", oldline)
return line
commentBloc.append(line)
continue
- if seen_vars.has_key(var):
+ if var in seen_vars:
for c in commentBloc: seen_vars[var].append(c)
commentBloc = []
seen_vars[var].append(line)
line = follow_rule(5, line)
if var == "":
if not in_routine:
- print "## Warning: unknown variable/routine \"%s\"" % originalLine.rstrip('\n')
+ print ("## Warning: unknown variable/routine \"%s\"" % originalLine.rstrip('\n'))
var = 'others'
for c in commentBloc: seen_vars[var].append(c)
commentBloc = []
for l in seen_vars[k]:
olines.append(l)
previourVarPrefix = k.split('_')[0]=='' and "unknown" or k.split('_')[0]
- for line in olines: print line
+ for line in olines: print(line)