blob: b860658975059eb8b23df96bb807601ed2efe640 [file] [log] [blame]
Bram Moolenaar071d4272004-06-13 20:20:40 +00001" Vim syntax file
2" Language: Pyrex
3" Maintainer: Marco Barisione <marco.bari@people.it>
4" URL: http://marcobari.altervista.org/pyrex_vim.html
Bram Moolenaar5c736222010-01-06 20:54:52 +01005" Last Change: 2009 Nov 09
Bram Moolenaar071d4272004-06-13 20:20:40 +00006
Bram Moolenaar89bcfda2016-08-30 23:26:57 +02007" quit when a syntax file was already loaded
8if exists("b:current_syntax")
Bram Moolenaar071d4272004-06-13 20:20:40 +00009 finish
10endif
11
12" Read the Python syntax to start with
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020013runtime! syntax/python.vim
14unlet b:current_syntax
Bram Moolenaar071d4272004-06-13 20:20:40 +000015
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
Bram Moolenaar5c736222010-01-06 20:54:52 +010021syn keyword pyrexInclude include cimport
Bram Moolenaar071d4272004-06-13 20:20:40 +000022syn 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
Bram Moolenaar5c736222010-01-06 20:54:52 +010031syn clear pythonInclude
32syn keyword pythonInclude import
33syn match pythonInclude "from"
Bram Moolenaar071d4272004-06-13 20:20:40 +000034
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
Bram Moolenaarf37506f2016-08-31 22:22:10 +020040hi def link pyrexStatement Statement
41hi def link pyrexType Type
42hi def link pyrexStructure Structure
43hi def link pyrexInclude PreCondit
44hi def link pyrexAccess pyrexStatement
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020045if exists("python_highlight_builtins") || exists("pyrex_highlight_builtins")
Bram Moolenaarf37506f2016-08-31 22:22:10 +020046hi def link pyrexBuiltin Function
Bram Moolenaar071d4272004-06-13 20:20:40 +000047endif
Bram Moolenaarf37506f2016-08-31 22:22:10 +020048hi def link pyrexForFrom Statement
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020049
Bram Moolenaar071d4272004-06-13 20:20:40 +000050
51let b:current_syntax = "pyrex"