mirror of
https://github.com/python/cpython.git
synced 2025-09-27 10:50:04 +00:00
Minor fixups.
This commit is contained in:
parent
b4c1d9be8f
commit
4f0c6b2b70
1 changed files with 4 additions and 2 deletions
|
@ -8,6 +8,7 @@ Designed to catch common markup errors including:
|
||||||
* Unbalanced of mismatched \begin and \end blocks.
|
* Unbalanced of mismatched \begin and \end blocks.
|
||||||
* Misspelled or invalid LaTeX commands.
|
* Misspelled or invalid LaTeX commands.
|
||||||
* Use of forward slashes instead of backslashes for commands.
|
* Use of forward slashes instead of backslashes for commands.
|
||||||
|
* Table line size mismatches (only \lineii used in a tableii).
|
||||||
|
|
||||||
Command line usage:
|
Command line usage:
|
||||||
python texcheck.py [-h] [-k keyword] foobar.tex
|
python texcheck.py [-h] [-k keyword] foobar.tex
|
||||||
|
@ -137,7 +138,7 @@ def checkit(source, opts, morecmds=[]):
|
||||||
if '-v' in opts:
|
if '-v' in opts:
|
||||||
print ' --> ', openers
|
print ' --> ', openers
|
||||||
|
|
||||||
# Check table levels (make sure lineii only inside lineiii)
|
# Check table levels (make sure lineii only inside tableii)
|
||||||
m = tablestart.search(line)
|
m = tablestart.search(line)
|
||||||
if m:
|
if m:
|
||||||
tablelevel = m.group(1)
|
tablelevel = m.group(1)
|
||||||
|
@ -148,9 +149,10 @@ def checkit(source, opts, morecmds=[]):
|
||||||
if tableend.search(line):
|
if tableend.search(line):
|
||||||
tablelevel = ''
|
tablelevel = ''
|
||||||
|
|
||||||
|
lastline = lineno
|
||||||
for lineno, symbol in openers:
|
for lineno, symbol in openers:
|
||||||
print "Unmatched open delimiter '%s' on line %d" % (symbol, lineno)
|
print "Unmatched open delimiter '%s' on line %d" % (symbol, lineno)
|
||||||
print 'Done checking %d lines.' % (lineno,)
|
print 'Done checking %d lines.' % (lastline,)
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def main(args=None):
|
def main(args=None):
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue