" Vim syntax file" Language: Pyrex" Maintainer: John Tyree" Last Change: 2012 Nov 06" For version 5.x: Clear all syntax items" For version 6.x: Quit when a syntax file was already loadedif version < 600syntax clearelseif exists("b:current_syntax")finishendif" Read the Python syntax to start withif version < 600so <sfile>:p:h/python.vimelseruntime! syntax/python.vimunlet b:current_syntaxendif" Pyrex extentionssyn keyword pyrexStatement nogil inline typedef ctypedef sizeofsyn keyword pyrexType Py_ssize_t int long short float double char object void" Here we want slightly different behavior depending on whether we're declaring" variables or functions. c[p]def should work on the top level as a keyword, but" should ALSO work to identify functions and classes.syn match pyrexStatement "\<cp\?def\>"syn match pyrexStatement "\<cp\?def\>[^=]*(\@=" contains=pythonStatement,pyrexStatement,pythonFunction,pyrexType skipwhitesyn keyword pyrexType signed unsignedsyn keyword pyrexStructure struct union enumsyn keyword pyrexInclude include cimportsyn keyword pyrexAccess public private property readonly extern" If someome wants Python's built-ins highlighted probably he" also wants Pyrex's built-ins highlightedif exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")syn keyword pyrexBuiltin NULLendif" This deletes "from" from the keywords and re-adds it as a" match with lower priority than pyrexForFromsyn clear pythonIncludesyn keyword pythonInclude importsyn match pythonInclude "\<from\>"" With "for[^:]*\zsfrom" VIM does not match "for" anymore, so" I used the slower "\@<=" formsyn match pyrexForFrom "\(\<for\>[^:]*\)\@<=\<from\>"" Default highlightingif version >= 508 || !exists("did_pyrex_syntax_inits")if version < 508let did_pyrex_syntax_inits = 1command -nargs=+ HiLink hi link <args>elsecommand -nargs=+ HiLink hi def link <args>endifHiLink pyrexStatement StatementHiLink pyrexType TypeHiLink pyrexStructure StructureHiLink pyrexInclude PreConditHiLink pyrexAccess pyrexStatementif exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")HiLink pyrexBuiltin FunctionendifHiLink pyrexForFrom Statementdelcommand HiLinkendiflet b:current_syntax = "pyrex"
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。