Commit b9c07af4 authored by Raymond Hettinger's avatar Raymond Hettinger

Check for \NULL markup errors.

parent 7bbcde70
...@@ -99,6 +99,7 @@ def checkit(source, opts, morecmds=[]): ...@@ -99,6 +99,7 @@ def checkit(source, opts, morecmds=[]):
delimiters = re.compile(r'\\(begin|end){([_a-zA-Z]+)}|([()\[\]])') delimiters = re.compile(r'\\(begin|end){([_a-zA-Z]+)}|([()\[\]])')
braces = re.compile(r'({)|(})') braces = re.compile(r'({)|(})')
doubledwords = re.compile(r'(\b[A-za-z]+\b) \b\1\b') doubledwords = re.compile(r'(\b[A-za-z]+\b) \b\1\b')
nullmarkup = re.compile(r'\NULL(?!\{\})')
openers = [] # Stack of pending open delimiters openers = [] # Stack of pending open delimiters
bracestack = [] # Stack of pending open braces bracestack = [] # Stack of pending open braces
...@@ -151,6 +152,10 @@ def checkit(source, opts, morecmds=[]): ...@@ -151,6 +152,10 @@ def checkit(source, opts, morecmds=[]):
if '\\' + cmd in validcmds: if '\\' + cmd in validcmds:
print 'Warning, forward slash used on line %d with cmd: /%s' % (lineno, cmd) 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 # Validate commands
nc = line.find(r'\newcommand') nc = line.find(r'\newcommand')
if nc != -1: if nc != -1:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment