2 " Language: XS (Perl extension interface language)
3 " Maintainer: Michael W. Dodge <sarge@pobox.com>
4 " Last Change: 2001 May 09
6 " For version 5.x: Clear all syntax items
7 " For version 6.x: Quit when a syntax file was already loaded
10 elseif exists("b:current_syntax")
14 " Read the C syntax to start with
16 source <sfile>:p:h/c.vim
22 " TODO: Figure out how to look for trailing '='.
23 syn keyword xsKeyword MODULE PACKAGE PREFIX
24 syn keyword xsKeyword OUTPUT: CODE: INIT: PREINIT: INPUT:
25 syn keyword xsKeyword PPCODE: REQUIRE: CLEANUP: BOOT:
26 syn keyword xsKeyword VERSIONCHECK: PROTOTYPES: PROTOTYPE:
27 syn keyword xsKeyword ALIAS: INCLUDE: CASE:
28 " TODO: Figure out how to look for trailing '('.
29 syn keyword xsMacro SV EXTEND PUSHs
30 syn 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*$"
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
37 if version >= 508 || !exists("did_xs_syntax_inits")
39 let did_xs_syntax_inits = 1
40 command -nargs=+ HiLink hi link <args>
42 command -nargs=+ HiLink hi def link <args>
45 HiLink xsKeyword Keyword
47 HiLink xsVariable Identifier
52 let b:current_syntax = "xs"