xref: /vim-8.2.3635/runtime/syntax/xs.vim (revision 0fa313a7)
1" Vim syntax file
2" Language:	XS (Perl extension interface language)
3" Maintainer:	Michael W. Dodge <[email protected]>
4" Last Change:	2001 May 09
5
6" For version 5.x: Clear all syntax items
7" For version 6.x: Quit when a syntax file was already loaded
8if version < 600
9  syntax clear
10elseif exists("b:current_syntax")
11  finish
12endif
13
14" Read the C syntax to start with
15if version < 600
16  source <sfile>:p:h/c.vim
17else
18  runtime! syntax/c.vim
19endif
20
21" XS extentions
22" TODO: Figure out how to look for trailing '='.
23syn keyword xsKeyword	MODULE PACKAGE PREFIX
24syn keyword xsKeyword	OUTPUT: CODE: INIT: PREINIT: INPUT:
25syn keyword xsKeyword	PPCODE: REQUIRE: CLEANUP: BOOT:
26syn keyword xsKeyword	VERSIONCHECK: PROTOTYPES: PROTOTYPE:
27syn keyword xsKeyword	ALIAS: INCLUDE: CASE:
28" TODO: Figure out how to look for trailing '('.
29syn keyword xsMacro	SV EXTEND PUSHs
30syn keyword xsVariable	RETVAL NO_INIT
31"syn match xsCast	"\<\(const\|static\|dynamic\|reinterpret\)_cast\s*<"me=e-1
32"syn match xsCast	"\<\(const\|static\|dynamic\|reinterpret\)_cast\s*$"
33
34" Define the default highlighting.
35" For version 5.7 and earlier: only when not done already
36" For version 5.8 and later: only when an item doesn't have highlighting yet
37if version >= 508 || !exists("did_xs_syntax_inits")
38  if version < 508
39    let did_xs_syntax_inits = 1
40    command -nargs=+ HiLink hi link <args>
41  else
42    command -nargs=+ HiLink hi def link <args>
43  endif
44
45  HiLink xsKeyword	Keyword
46  HiLink xsMacro	Macro
47  HiLink xsVariable	Identifier
48
49  delcommand HiLink
50endif
51
52let b:current_syntax = "xs"
53
54" vim: ts=8
55