summaryrefslogtreecommitdiff
path: root/scripts/find_error.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/find_error.py')
-rw-r--r--scripts/find_error.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/scripts/find_error.py b/scripts/find_error.py
index e210028a..a7719b3f 100644
--- a/scripts/find_error.py
+++ b/scripts/find_error.py
@@ -40,12 +40,17 @@ def main(fn):
for type, val in lx.get_tokens(text):
if type == Error:
print "Error parsing", fn
- print "\n".join([' ' + repr(x) for x in ntext[-5:]])
+ print "\n".join([' ' + repr(x) for x in ntext[-num:]])
print `val` + "<<<"
return
ntext.append((type,val))
+num = 10
+
if __name__ == "__main__":
+ if sys.argv[1][:2] == '-n':
+ num = int(sys.argv[1][2:])
+ del sys.argv[1]
for f in sys.argv[1:]:
main(f)