xref: /vim-8.2.3635/runtime/syntax/pyrex.vim (revision bb76f24a)
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
40hi def link pyrexStatement		Statement
41hi def link pyrexType		Type
42hi def link pyrexStructure		Structure
43hi def link pyrexInclude		PreCondit
44hi def link pyrexAccess		pyrexStatement
45if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")
46hi def link pyrexBuiltin	Function
47endif
48hi def link pyrexForFrom		Statement
49
50
51let b:current_syntax = "pyrex"
52