mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Make python.vim output more deterministic.
This commit is contained in:
parent
f6aa86e33b
commit
c8939d23fe
3 changed files with 36 additions and 32 deletions
|
@ -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}"',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue