Make python.vim output more deterministic.

This commit is contained in:
Brett Cannon 2006-09-20 19:28:35 +00:00
parent f6aa86e33b
commit c8939d23fe
3 changed files with 36 additions and 32 deletions

View File

@ -103,6 +103,10 @@ Documentation
Tools
-----
- Make auto-generated python.vim file list built-ins and exceptions in
alphatbetical order. Makes output more deterministic and easier to tell if
the file is stale or not.
- Bug #1546372: Fixed small bugglet in pybench that caused a missing
file not to get reported properly.

View File

@ -62,39 +62,39 @@ endif
if exists("python_highlight_builtins")
syn keyword pythonBuiltin unichr all set abs vars int __import__ unicode
syn keyword pythonBuiltin enumerate reduce coerce intern exit issubclass
syn keyword pythonBuiltin divmod file Ellipsis apply isinstance open any
syn keyword pythonBuiltin locals help filter basestring slice copyright min
syn keyword pythonBuiltin super sum tuple hex execfile long id xrange chr
syn keyword pythonBuiltin complex bool zip pow dict True oct NotImplemented
syn keyword pythonBuiltin map None float hash getattr buffer max reversed
syn keyword pythonBuiltin object quit len repr callable credits setattr
syn keyword pythonBuiltin eval frozenset sorted ord __debug__ hasattr
syn keyword pythonBuiltin delattr False input license classmethod type
syn keyword pythonBuiltin raw_input list iter compile reload range globals
syn keyword pythonBuiltin staticmethod str property round dir cmp
syn keyword pythonBuiltin Ellipsis False None NotImplemented True __debug__
syn keyword pythonBuiltin __import__ abs all any apply basestring bool
syn keyword pythonBuiltin buffer callable chr classmethod cmp coerce
syn keyword pythonBuiltin compile complex copyright credits delattr dict
syn keyword pythonBuiltin dir divmod enumerate eval execfile exit file
syn keyword pythonBuiltin filter float frozenset getattr globals hasattr
syn keyword pythonBuiltin hash help hex id input int intern isinstance
syn keyword pythonBuiltin issubclass iter len license list locals long map
syn keyword pythonBuiltin max min object oct open ord pow property quit
syn keyword pythonBuiltin range raw_input reduce reload repr reversed round
syn keyword pythonBuiltin set setattr slice sorted staticmethod str sum
syn keyword pythonBuiltin super tuple type unichr unicode vars xrange zip
endif
if exists("python_highlight_exceptions")
syn keyword pythonException GeneratorExit ImportError RuntimeError
syn keyword pythonException UnicodeTranslateError MemoryError StopIteration
syn keyword pythonException PendingDeprecationWarning EnvironmentError
syn keyword pythonException LookupError OSError DeprecationWarning
syn keyword pythonException UnicodeError UnicodeEncodeError
syn keyword pythonException FloatingPointError ReferenceError NameError
syn keyword pythonException IOError SyntaxError
syn keyword pythonException FutureWarning ImportWarning SystemExit
syn keyword pythonException Exception EOFError StandardError ValueError
syn keyword pythonException TabError KeyError ZeroDivisionError SystemError
syn keyword pythonException UnicodeDecodeError IndentationError
syn keyword pythonException AssertionError TypeError IndexError
syn keyword pythonException RuntimeWarning KeyboardInterrupt UserWarning
syn keyword pythonException SyntaxWarning UnboundLocalError ArithmeticError
syn keyword pythonException Warning NotImplementedError AttributeError
syn keyword pythonException OverflowError BaseException
syn keyword pythonException ArithmeticError AssertionError AttributeError
syn keyword pythonException BaseException DeprecationWarning EOFError
syn keyword pythonException EnvironmentError Exception FloatingPointError
syn keyword pythonException FutureWarning GeneratorExit IOError ImportError
syn keyword pythonException ImportWarning IndentationError IndexError
syn keyword pythonException KeyError KeyboardInterrupt LookupError
syn keyword pythonException MemoryError NameError NotImplementedError
syn keyword pythonException OSError OverflowError PendingDeprecationWarning
syn keyword pythonException ReferenceError RuntimeError RuntimeWarning
syn keyword pythonException StandardError StopIteration SyntaxError
syn keyword pythonException SyntaxWarning SystemError SystemExit TabError
syn keyword pythonException TypeError UnboundLocalError UnicodeDecodeError
syn keyword pythonException UnicodeEncodeError UnicodeError
syn keyword pythonException UnicodeTranslateError UnicodeWarning
syn keyword pythonException UserWarning ValueError Warning
syn keyword pythonException ZeroDivisionError
endif

View File

@ -5,9 +5,9 @@ import exceptions
import __builtin__
from string import Template
comment_header = """" Auto-generated Vim syntax file for Python
comment_header = '''" Auto-generated Vim syntax file for Python.
"
" To use: copy or symlink to ~/.vim/syntax/python.vim"""
" To use: copy or symlink to ~/.vim/syntax/python.vim'''
statement_header = """
if exists("b:current_syntax")
@ -30,14 +30,14 @@ boolean_ops = ('and', 'in', 'is', 'not', 'or')
import_stmts = ('import', 'from')
object_defs = ('def', 'class')
exception_names = frozenset(exc for exc in dir(exceptions)
exception_names = sorted(exc for exc in dir(exceptions)
if not exc.startswith('__'))
# Need to include functions that start with '__' (e.g., __import__), but
# nothing that comes with modules (e.g., __name__), so just exclude anything in
# the 'exceptions' module since we want to ignore exceptions *and* what any
# module would have
builtin_names = frozenset(builtin for builtin in dir(__builtin__)
builtin_names = sorted(builtin for builtin in dir(__builtin__)
if builtin not in dir(exceptions))
escapes = (r'+\\[abfnrtv\'"\\]+', r'"\\\o\{1,3}"', r'"\\x\x\{2}"',