Mercurial > cpython-lru_cache-weakref
diff Tools/scripts/texcheck.py @ 30369:e4cc232ed583 legacy-trunk
Check for \NULL markup errors.
| author | Raymond Hettinger <python@rcn.com> |
|---|---|
| date | Mon, 08 Sep 2003 17:33:31 +0000 |
| parents | 2db8c63e69cd |
| children | cf7fad9d6fcc |
line wrap: on
line diff
--- a/Tools/scripts/texcheck.py Sun Sep 07 20:42:29 2003 +0000 +++ b/Tools/scripts/texcheck.py Mon Sep 08 17:33:31 2003 +0000 @@ -99,6 +99,7 @@ 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 bracestack = [] # Stack of pending open braces @@ -151,6 +152,10 @@ if '\\' + cmd in validcmds: 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') if nc != -1:
