[Python-checkins] python/dist/src/Tools/scripts texcheck.py, 1.6,
1.6.8.1
rhettinger at users.sourceforge.net
rhettinger at users.sourceforge.net
Mon Sep 8 11:36:13 EDT 2003
Update of /cvsroot/python/python/dist/src/Tools/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv21871
Modified Files:
Tag: release23-maint
texcheck.py
Log Message:
Check for \NULL markup errors and doubled words.
Index: texcheck.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Tools/scripts/texcheck.py,v
retrieving revision 1.6
retrieving revision 1.6.8.1
diff -C2 -d -r1.6 -r1.6.8.1
*** texcheck.py 16 May 2003 03:06:39 -0000 1.6
--- texcheck.py 8 Sep 2003 17:36:11 -0000 1.6.8.1
***************
*** 99,102 ****
--- 99,104 ----
delimiters = re.compile(r'\\(begin|end){([_a-zA-Z]+)}|([()\[\]])')
braces = re.compile(r'({)|(})')
+ doubledwords = re.compile(r'(\b[A-za-z]+\b) \b\1\b')
+ nullmarkup = re.compile(r'\NULL(?!\{\})')
openers = [] # Stack of pending open delimiters
***************
*** 151,154 ****
--- 153,160 ----
print 'Warning, forward slash used on line %d with cmd: /%s' % (lineno, cmd)
+ # Check for bad markup
+ if nullmarkup.search(line):
+ print r'Warning, \NULL should be written as \NULL{} on line %d' % (lineno,)
+
# Validate commands
nc = line.find(r'\newcommand')
***************
*** 176,179 ****
--- 182,187 ----
print r'Style warning, avoid use of i.e or e.g. on line %d' % (lineno,)
+ for dw in doubledwords.findall(line):
+ print r'Doubled word warning. "%s" on line %d' % (dw, lineno)
lastline = lineno
More information about the Python-checkins
mailing list