Kaydet (Commit) c8939d23 authored tarafından Brett Cannon's avatar Brett Cannon

Make python.vim output more deterministic.

üst f6aa86e3
...@@ -103,6 +103,10 @@ Documentation ...@@ -103,6 +103,10 @@ Documentation
Tools 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 - Bug #1546372: Fixed small bugglet in pybench that caused a missing
file not to get reported properly. file not to get reported properly.
......
...@@ -62,39 +62,39 @@ endif ...@@ -62,39 +62,39 @@ endif
if exists("python_highlight_builtins") if exists("python_highlight_builtins")
syn keyword pythonBuiltin unichr all set abs vars int __import__ unicode syn keyword pythonBuiltin Ellipsis False None NotImplemented True __debug__
syn keyword pythonBuiltin enumerate reduce coerce intern exit issubclass syn keyword pythonBuiltin __import__ abs all any apply basestring bool
syn keyword pythonBuiltin divmod file Ellipsis apply isinstance open any syn keyword pythonBuiltin buffer callable chr classmethod cmp coerce
syn keyword pythonBuiltin locals help filter basestring slice copyright min syn keyword pythonBuiltin compile complex copyright credits delattr dict
syn keyword pythonBuiltin super sum tuple hex execfile long id xrange chr syn keyword pythonBuiltin dir divmod enumerate eval execfile exit file
syn keyword pythonBuiltin complex bool zip pow dict True oct NotImplemented syn keyword pythonBuiltin filter float frozenset getattr globals hasattr
syn keyword pythonBuiltin map None float hash getattr buffer max reversed syn keyword pythonBuiltin hash help hex id input int intern isinstance
syn keyword pythonBuiltin object quit len repr callable credits setattr syn keyword pythonBuiltin issubclass iter len license list locals long map
syn keyword pythonBuiltin eval frozenset sorted ord __debug__ hasattr syn keyword pythonBuiltin max min object oct open ord pow property quit
syn keyword pythonBuiltin delattr False input license classmethod type syn keyword pythonBuiltin range raw_input reduce reload repr reversed round
syn keyword pythonBuiltin raw_input list iter compile reload range globals syn keyword pythonBuiltin set setattr slice sorted staticmethod str sum
syn keyword pythonBuiltin staticmethod str property round dir cmp syn keyword pythonBuiltin super tuple type unichr unicode vars xrange zip
endif endif
if exists("python_highlight_exceptions") if exists("python_highlight_exceptions")
syn keyword pythonException GeneratorExit ImportError RuntimeError syn keyword pythonException ArithmeticError AssertionError AttributeError
syn keyword pythonException UnicodeTranslateError MemoryError StopIteration syn keyword pythonException BaseException DeprecationWarning EOFError
syn keyword pythonException PendingDeprecationWarning EnvironmentError syn keyword pythonException EnvironmentError Exception FloatingPointError
syn keyword pythonException LookupError OSError DeprecationWarning syn keyword pythonException FutureWarning GeneratorExit IOError ImportError
syn keyword pythonException UnicodeError UnicodeEncodeError syn keyword pythonException ImportWarning IndentationError IndexError
syn keyword pythonException FloatingPointError ReferenceError NameError syn keyword pythonException KeyError KeyboardInterrupt LookupError
syn keyword pythonException IOError SyntaxError syn keyword pythonException MemoryError NameError NotImplementedError
syn keyword pythonException FutureWarning ImportWarning SystemExit syn keyword pythonException OSError OverflowError PendingDeprecationWarning
syn keyword pythonException Exception EOFError StandardError ValueError syn keyword pythonException ReferenceError RuntimeError RuntimeWarning
syn keyword pythonException TabError KeyError ZeroDivisionError SystemError syn keyword pythonException StandardError StopIteration SyntaxError
syn keyword pythonException UnicodeDecodeError IndentationError syn keyword pythonException SyntaxWarning SystemError SystemExit TabError
syn keyword pythonException AssertionError TypeError IndexError syn keyword pythonException TypeError UnboundLocalError UnicodeDecodeError
syn keyword pythonException RuntimeWarning KeyboardInterrupt UserWarning syn keyword pythonException UnicodeEncodeError UnicodeError
syn keyword pythonException SyntaxWarning UnboundLocalError ArithmeticError syn keyword pythonException UnicodeTranslateError UnicodeWarning
syn keyword pythonException Warning NotImplementedError AttributeError syn keyword pythonException UserWarning ValueError Warning
syn keyword pythonException OverflowError BaseException syn keyword pythonException ZeroDivisionError
endif endif
......
...@@ -5,9 +5,9 @@ import exceptions ...@@ -5,9 +5,9 @@ import exceptions
import __builtin__ import __builtin__
from string import Template 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 = """ statement_header = """
if exists("b:current_syntax") if exists("b:current_syntax")
...@@ -30,14 +30,14 @@ boolean_ops = ('and', 'in', 'is', 'not', 'or') ...@@ -30,14 +30,14 @@ boolean_ops = ('and', 'in', 'is', 'not', 'or')
import_stmts = ('import', 'from') import_stmts = ('import', 'from')
object_defs = ('def', 'class') 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('__')) if not exc.startswith('__'))
# Need to include functions that start with '__' (e.g., __import__), but # Need to include functions that start with '__' (e.g., __import__), but
# nothing that comes with modules (e.g., __name__), so just exclude anything in # 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 # the 'exceptions' module since we want to ignore exceptions *and* what any
# module would have # 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)) if builtin not in dir(exceptions))
escapes = (r'+\\[abfnrtv\'"\\]+', r'"\\\o\{1,3}"', r'"\\x\x\{2}"', escapes = (r'+\\[abfnrtv\'"\\]+', r'"\\\o\{1,3}"', r'"\\x\x\{2}"',
......
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