diff options
author | Raymond Hettinger <python@rcn.com> | 2003-09-08 18:43:46 (GMT) |
---|---|---|
committer | Raymond Hettinger <python@rcn.com> | 2003-09-08 18:43:46 (GMT) |
commit | c60577ea594a6d07eb279aa958180d6591cf680a (patch) | |
tree | 532831ebe46f845ca9006b06844c2160c6560449 /Tools/scripts/texcheck.py | |
parent | b9c07af46c6761db7e938c8ef8f983ae9fa402a1 (diff) | |
download | cpython-c60577ea594a6d07eb279aa958180d6591cf680a.zip cpython-c60577ea594a6d07eb279aa958180d6591cf680a.tar.gz cpython-c60577ea594a6d07eb279aa958180d6591cf680a.tar.bz2 |
Generalize the last change to check for other markup spacing errors.
Diffstat (limited to 'Tools/scripts/texcheck.py')
-rw-r--r-- | Tools/scripts/texcheck.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Tools/scripts/texcheck.py b/Tools/scripts/texcheck.py index a2c8905..b631dbc 100644 --- a/Tools/scripts/texcheck.py +++ b/Tools/scripts/texcheck.py @@ -99,7 +99,7 @@ def checkit(source, opts, morecmds=[]): 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(?!\{\})') + spacingmarkup = re.compile(r'\\(ABC|ASCII|C|Cpp|EOF|infinity|NULL|plusminus|POSIX|UNIX)\s') openers = [] # Stack of pending open delimiters bracestack = [] # Stack of pending open braces @@ -152,9 +152,9 @@ def checkit(source, opts, morecmds=[]): 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,) + # Check for markup requiring {} for correct spacing + for cmd in spacingmarkup.findall(line): + print r'Warning, \%s should be written as \%s{} on line %d' % (cmd, cmd, lineno) # Validate commands nc = line.find(r'\newcommand') |