xref: /vim-8.2.3635/runtime/syntax/pyrex.vim (revision 89bcfda6)
1" Vim syntax file
2" Language:	Pyrex
3" Maintainer:	Marco Barisione <[email protected]>
4" URL:		http://marcobari.altervista.org/pyrex_vim.html
5" Last Change:	2009 Nov 09
6
7" quit when a syntax file was already loaded
8if exists("b:current_syntax")
9  finish
10endif
11
12" Read the Python syntax to start with
13runtime! syntax/python.vim
14unlet b:current_syntax
15
16" Pyrex extentions
17syn keyword pyrexStatement      cdef typedef ctypedef sizeof
18syn keyword pyrexType		int long short float double char object void
19syn keyword pyrexType		signed unsigned
20syn keyword pyrexStructure	struct union enum
21syn keyword pyrexInclude	include cimport
22syn keyword pyrexAccess		public private property readonly extern
23" If someome wants Python's built-ins highlighted probably he
24" also wants Pyrex's built-ins highlighted
25if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")
26    syn keyword pyrexBuiltin    NULL
27endif
28
29" This deletes "from" from the keywords and re-adds it as a
30" match with lower priority than pyrexForFrom
31syn clear   pythonInclude
32syn keyword pythonInclude     import
33syn match   pythonInclude     "from"
34
35" With "for[^:]*\zsfrom" VIM does not match "for" anymore, so
36" I used the slower "\@<=" form
37syn match   pyrexForFrom        "\(for[^:]*\)\@<=from"
38
39" Default highlighting
40command -nargs=+ HiLink hi def link <args>
41HiLink pyrexStatement		Statement
42HiLink pyrexType		Type
43HiLink pyrexStructure		Structure
44HiLink pyrexInclude		PreCondit
45HiLink pyrexAccess		pyrexStatement
46if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")
47HiLink pyrexBuiltin	Function
48endif
49HiLink pyrexForFrom		Statement
50
51delcommand HiLink
52
53let b:current_syntax = "pyrex"
54