blob: cd743df8895e1a3ae5d4d831ef45ac79f6ef3b65 [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 Moolenaar89bcfda2016-08-30 23:26:57 +020040command -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
Bram Moolenaar071d4272004-06-13 20:20:40 +000048endif
Bram Moolenaar89bcfda2016-08-30 23:26:57 +020049HiLink pyrexForFrom Statement
50
51delcommand HiLink
Bram Moolenaar071d4272004-06-13 20:20:40 +000052
53let b:current_syntax = "pyrex"