久久精品精选,精品九九视频,www久久只有这里有精品,亚洲熟女乱色综合一区
    分享

    Python.vim

     微絲淚 2018-09-07
    " Vim syntax file
    " Language: Python
    " Maintainer: Zvezdan Petkovic <zpetkovic@acm.org>
    " Last Change: 2016 Feb 20
    " Credits: Neil Schemenauer <nas@python.ca>
    " Dmitry Vasiliev
    "
    " This version is a major rewrite by Zvezdan Petkovic.
    "
    " - introduced highlighting of doctests
    " - updated keywords, built-ins, and exceptions
    " - corrected regular expressions for
    "
    "   * functions
    "   * decorators
    "   * strings
    "   * escapes
    "   * numbers
    "   * space error
    "
    " - corrected synchronization
    " - more highlighting is ON by default, except
    " - space error highlighting is OFF by default
    "
    " Optional highlighting can be controlled using these variables.
    "
    "   let python_no_builtin_highlight = 1
    "   let python_no_doctest_code_highlight = 1
    "   let python_no_doctest_highlight = 1
    "   let python_no_exception_highlight = 1
    "   let python_no_number_highlight = 1
    "   let python_space_error_highlight = 1
    "
    " All the options above can be switched on together.
    "
    "   let python_highlight_all = 1
    "

    " For version 5.x: Clear all syntax items.
    " For version 6.x: Quit when a syntax file was already loaded.
    if version < 600
      syntax clear
    elseif exists("b:current_syntax")
      finish
    endif

    " We need nocompatible mode in order to continue lines with backslashes.
    " Original setting will be restored.
    let s:cpo_save = &cpo
    set cpo&vim

    " Keep Python keywords in alphabetical order inside groups for easy
    " comparison with the table in the 'Python Language Reference'
    " https://docs./2/reference/lexical_analysis.html#keywords,
    " https://docs./3/reference/lexical_analysis.html#keywords.
    " Groups are in the order presented in NAMING CONVENTIONS in syntax.txt.
    " Exceptions come last at the end of each group (class and def below).
    "
    " Keywords 'with' and 'as' are new in Python 2.6
    " (use 'from __future__ import with_statement' in Python 2.5).
    "
    " Some compromises had to be made to support both Python 3 and 2.
    " We include Python 3 features, but when a definition is duplicated,
    " the last definition takes precedence.
    "
    " - 'False', 'None', and 'True' are keywords in Python 3 but they are
    "   built-ins in 2 and will be highlighted as built-ins below.
    " - 'exec' is a built-in in Python 3 and will be highlighted as
    "   built-in below.
    " - 'nonlocal' is a keyword in Python 3 and will be highlighted.
    " - 'print' is a built-in in Python 3 and will be highlighted as
    "   built-in below (use 'from __future__ import print_function' in 2)
    " - async and await were added in Python 3.5 and are soft keywords.
    "
    syn keyword pythonStatement False, None, True
    syn keyword pythonStatement as assert break continue del exec global
    syn keyword pythonStatement lambda nonlocal pass print return with yield
    syn keyword pythonStatement class def nextgroup=pythonFunction skipwhite
    syn keyword pythonConditional elif else if
    syn keyword pythonRepeat for while
    syn keyword pythonOperator and in is not or
    syn keyword pythonException except finally raise try
    syn keyword pythonInclude from import
    syn keyword pythonAsync async await

    " Decorators (new in Python 2.4)
    syn match   pythonDecorator "@" display nextgroup=pythonFunction skipwhite
    " The zero-length non-grouping match before the function name is
    " extremely important in pythonFunction.  Without it, everything is
    " interpreted as a function inside the contained environment of
    " doctests.
    " A dot must be allowed because of @MyClass.myfunc decorators.
    syn match   pythonFunction
          \ "\%(\%(def\s\|class\s\|@\)\s*\)\@<=\h\%(\w\|\.\)*" contained

    syn match   pythonComment "#.*$" contains=pythonTodo,@Spell
    syn keyword pythonTodo FIXME NOTE NOTES TODO XXX contained

    " Triple-quoted strings can contain doctests.
    syn region  pythonString matchgroup=pythonQuotes
          \ start=+[uU]\=\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
          \ contains=pythonEscape,@Spell
    syn region  pythonString matchgroup=pythonTripleQuotes
          \ start=+[uU]\=\z('''\|"""\)+ end="\z1" keepend
          \ contains=pythonEscape,pythonSpaceError,pythonDoctest,@Spell
    syn region  pythonRawString matchgroup=pythonQuotes
          \ start=+[uU]\=[rR]\z(['"]\)+ end="\z1" skip="\\\\\|\\\z1"
          \ contains=@Spell
    syn region  pythonRawString matchgroup=pythonTripleQuotes
          \ start=+[uU]\=[rR]\z('''\|"""\)+ end="\z1" keepend
          \ contains=pythonSpaceError,pythonDoctest,@Spell

    syn match   pythonEscape +\\[abfnrtv'"\\]+ contained
    syn match   pythonEscape "\\\o\{1,3}" contained
    syn match   pythonEscape "\\x\x\{2}" contained
    syn match   pythonEscape "\%(\\u\x\{4}\|\\U\x\{8}\)" contained
    " Python allows case-insensitive Unicode IDs: http://www./charts/
    syn match   pythonEscape "\\N{\a\+\%(\s\a\+\)*}" contained
    syn match   pythonEscape "\\$"

    if exists("python_highlight_all")
      if exists("python_no_builtin_highlight")
        unlet python_no_builtin_highlight
      endif
      if exists("python_no_doctest_code_highlight")
        unlet python_no_doctest_code_highlight
      endif
      if exists("python_no_doctest_highlight")
        unlet python_no_doctest_highlight
      endif
      if exists("python_no_exception_highlight")
        unlet python_no_exception_highlight
      endif
      if exists("python_no_number_highlight")
        unlet python_no_number_highlight
      endif
      let python_space_error_highlight = 1
    endif

    " It is very important to understand all details before changing the
    " regular expressions below or their order.
    " The word boundaries are *not* the floating-point number boundaries
    " because of a possible leading or trailing decimal point.
    " The expressions below ensure that all valid number literals are
    " highlighted, and invalid number literals are not.  For example,
    "
    " - a decimal point in '4.' at the end of a line is highlighted,
    " - a second dot in 1.0.0 is not highlighted,
    " - 08 is not highlighted,
    " - 08e0 or 08j are highlighted,
    "
    " and so on, as specified in the 'Python Language Reference'.
    " https://docs./2/reference/lexical_analysis.html#numeric-literals
    " https://docs./3/reference/lexical_analysis.html#numeric-literals
    if !exists("python_no_number_highlight")
      " numbers (including longs and complex)
      syn match   pythonNumber "\<0[oO]\=\o\+[Ll]\=\>"
      syn match   pythonNumber "\<0[xX]\x\+[Ll]\=\>"
      syn match   pythonNumber "\<0[bB][01]\+[Ll]\=\>"
      syn match   pythonNumber "\<\%([1-9]\d*\|0\)[Ll]\=\>"
      syn match   pythonNumber "\<\d\+[jJ]\>"
      syn match   pythonNumber "\<\d\+[eE][+-]\=\d\+[jJ]\=\>"
      syn match   pythonNumber
    \ "\<\d\+\.\%([eE][+-]\=\d\+\)\=[jJ]\=\%(\W\|$\)\@="
      syn match   pythonNumber
    \ "\%(^\|\W\)\zs\d*\.\d\+\%([eE][+-]\=\d\+\)\=[jJ]\=\>"
    endif

    " Group the built-ins in the order in the 'Python Library Reference' for
    " easier comparison.
    " https://docs./2/library/constants.html
    " https://docs./3/library/constants.html
    " http://docs./2/library/functions.html
    " http://docs./3/library/functions.html
    " http://docs./2/library/functions.html#non-essential-built-in-functions
    " http://docs./3/library/functions.html#non-essential-built-in-functions
    " Python built-in functions are in alphabetical order.
    if !exists("python_no_builtin_highlight")
      " built-in constants
      " 'False', 'True', and 'None' are also reserved words in Python 3
      syn keyword pythonBuiltin False True None
      syn keyword pythonBuiltin NotImplemented Ellipsis __debug__
      " built-in functions
      syn keyword pythonBuiltin abs all any bin bool bytearray callable chr
      syn keyword pythonBuiltin classmethod compile complex delattr dict dir
      syn keyword pythonBuiltin divmod enumerate eval filter float format
      syn keyword pythonBuiltin frozenset getattr globals hasattr hash
      syn keyword pythonBuiltin help hex id input int isinstance
      syn keyword pythonBuiltin issubclass iter len list locals map max
      syn keyword pythonBuiltin memoryview min next object oct open ord pow
      syn keyword pythonBuiltin print property range repr reversed round set
      syn keyword pythonBuiltin setattr slice sorted staticmethod str
      syn keyword pythonBuiltin sum super tuple type vars zip __import__
      " Python 2 only
      syn keyword pythonBuiltin basestring cmp execfile file
      syn keyword pythonBuiltin long raw_input reduce reload unichr
      syn keyword pythonBuiltin unicode xrange
      " Python 3 only
      syn keyword pythonBuiltin ascii bytes exec
      " non-essential built-in functions; Python 2 only
      syn keyword pythonBuiltin apply buffer coerce intern
      " avoid highlighting attributes as builtins
      syn match   pythonAttribute /\.\h\w*/hs=s+1 contains=ALLBUT,pythonBuiltin transparent
    endif

    " From the 'Python Library Reference' class hierarchy at the bottom.
    " http://docs./2/library/exceptions.html
    " http://docs./3/library/exceptions.html
    if !exists("python_no_exception_highlight")
      " builtin base exceptions (used mostly as base classes for other exceptions)
      syn keyword pythonExceptions BaseException Exception
      syn keyword pythonExceptions ArithmeticError BufferError
      syn keyword pythonExceptions LookupError
      " builtin base exceptions removed in Python 3
      syn keyword pythonExceptions EnvironmentError StandardError
      " builtin exceptions (actually raised)
      syn keyword pythonExceptions AssertionError AttributeError
      syn keyword pythonExceptions EOFError FloatingPointError GeneratorExit
      syn keyword pythonExceptions ImportError IndentationError
      syn keyword pythonExceptions IndexError KeyError KeyboardInterrupt
      syn keyword pythonExceptions MemoryError NameError NotImplementedError
      syn keyword pythonExceptions OSError OverflowError ReferenceError
      syn keyword pythonExceptions RuntimeError StopIteration SyntaxError
      syn keyword pythonExceptions SystemError SystemExit TabError TypeError
      syn keyword pythonExceptions UnboundLocalError UnicodeError
      syn keyword pythonExceptions UnicodeDecodeError UnicodeEncodeError
      syn keyword pythonExceptions UnicodeTranslateError ValueError
      syn keyword pythonExceptions ZeroDivisionError
      " builtin OS exceptions in Python 3
      syn keyword pythonExceptions BlockingIOError BrokenPipeError
      syn keyword pythonExceptions ChildProcessError ConnectionAbortedError
      syn keyword pythonExceptions ConnectionError ConnectionRefusedError
      syn keyword pythonExceptions ConnectionResetError FileExistsError
      syn keyword pythonExceptions FileNotFoundError InterruptedError
      syn keyword pythonExceptions IsADirectoryError NotADirectoryError
      syn keyword pythonExceptions PermissionError ProcessLookupError
      syn keyword pythonExceptions RecursionError StopAsyncIteration
      syn keyword pythonExceptions TimeoutError
      " builtin exceptions deprecated/removed in Python 3
      syn keyword pythonExceptions IOError VMSError WindowsError
      " builtin warnings
      syn keyword pythonExceptions BytesWarning DeprecationWarning FutureWarning
      syn keyword pythonExceptions ImportWarning PendingDeprecationWarning
      syn keyword pythonExceptions RuntimeWarning SyntaxWarning UnicodeWarning
      syn keyword pythonExceptions UserWarning Warning
      " builtin warnings in Python 3
      syn keyword pythonExceptions ResourceWarning
    endif

    if exists("python_space_error_highlight")
      " trailing whitespace
      syn match   pythonSpaceError display excludenl "\s\+$"
      " mixed tabs and spaces
      syn match   pythonSpaceError display " \+\t"
      syn match   pythonSpaceError display "\t\+ "
    endif

    " Do not spell doctests inside strings.
    " Notice that the end of a string, either ''', or """, will end the contained
    " doctest too.  Thus, we do *not* need to have it as an end pattern.
    if !exists("python_no_doctest_highlight")
      if !exists("python_no_doctest_code_highlight")
        syn region pythonDoctest
      \ start="^\s*>>>\s" end="^\s*$"
      \ contained contains=ALLBUT,pythonDoctest,@Spell
        syn region pythonDoctestValue
      \ start=+^\s*\%(>>>\s\|\.\.\.\s\|"""\|'''\)\@!\S\++ end="$"
      \ contained
      else
        syn region pythonDoctest
      \ start="^\s*>>>" end="^\s*$"
      \ contained contains=@NoSpell
      endif
    endif

    " Sync at the beginning of class, function, or method definition.
    syn sync match pythonSync grouphere NONE "^\s*\%(def\|class\)\s\+\h\w*\s*("

    if version >= 508 || !exists("did_python_syn_inits")
      if version <= 508
        let did_python_syn_inits = 1
        command -nargs=+ HiLink hi link <args>
      else
        command -nargs=+ HiLink hi def link <args>
      endif

      " The default highlight links.  Can be overridden later.
      HiLink pythonStatement Statement
      HiLink pythonConditional Conditional
      HiLink pythonRepeat Repeat
      HiLink pythonOperator Operator
      HiLink pythonException Exception
      HiLink pythonInclude Include
      HiLink pythonAsync Statement
      HiLink pythonDecorator Define
      HiLink pythonFunction Function
      HiLink pythonComment Comment
      HiLink pythonTodo Todo
      HiLink pythonString String
      HiLink pythonRawString String
      HiLink pythonQuotes String
      HiLink pythonTripleQuotes pythonQuotes
      HiLink pythonEscape Special
      if !exists("python_no_number_highlight")
        HiLink pythonNumber Number
      endif
      if !exists("python_no_builtin_highlight")
        HiLink pythonBuiltin Function
      endif
      if !exists("python_no_exception_highlight")
        HiLink pythonExceptions Structure
      endif
      if exists("python_space_error_highlight")
        HiLink pythonSpaceError Error
      endif
      if !exists("python_no_doctest_highlight")
        HiLink pythonDoctest Special
        HiLink pythonDoctestValue Define
      endif

      delcommand HiLink
    endif

    let b:current_syntax = "python"

    let &cpo = s:cpo_save
    unlet s:cpo_save

    " vim:set sw=2 sts=2 ts=8 noet:

      本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發布,不代表本站觀點。請注意甄別內容中的聯系方式、誘導購買等信息,謹防詐騙。如發現有害或侵權內容,請點擊一鍵舉報。
      轉藏 分享 獻花(0

      0條評論

      發表

      請遵守用戶 評論公約

      類似文章 更多

      主站蜘蛛池模板: 国产成人高清精品亚洲| 草裙社区精品视频播放| 无码AV无码免费一区二区| 四虎影视国产精品永久在线| 国产午夜无码视频在线观看| 中文字幕人妻系列人妻有码| 中文字幕日韩有码国产| 四虎国产精品成人| 国内精品免费久久久久电影院97| 天天影视网色香欲综合网| 下面一进一出好爽视频| 成人福利国产午夜AV免费不卡在线| 精品麻豆国产色欲色欲色欲WWW | 亚洲AV永久无码精品秋霞电影影院| 2019亚洲午夜无码天堂 | 99久久激情国产精品| 最新AV中文字幕无码专区| 无码人妻aⅴ一区二区三区蜜桃| 四虎影视永久无码精品 | 国产亚洲精AA在线观看SEE| 加勒比无码人妻东京热| 国精无码欧精品亚洲一区| 男人猛进出女人下面视频| 四虎亚洲精品无码| 国产免费午夜福利757| 亚洲av成人无码天堂| 日日噜噜夜夜狠狠视频| 亚洲高清日韩专区精品| 天天做天天爱天天爽综合网| 国产精品国语对白露脸在线播放| 亚洲AV综合色区在线观看| 熟妇啊轻点灬大JI巴太粗| 日韩精品中文字幕有码| 亚洲精品无码中文久久字幕| 国产对白老熟女正在播放| 推油少妇久久99久久99久久| 日日噜噜夜夜狠狠视频| 国产成人亚洲欧美二区综合| 欧美日韩在线视频| 护士张开腿被奷日出白浆| 久久这里只精品国产免费9|