annotate runtime/syntax/objc.vim @ 3691:4873d9c4ad3b v7.3.605

updated for version 7.3.605 Problem: MS-Windows: Can't compile with older compilers. (Titov Anatoly) Solution: Add #ifdef for MEMORYSTATUSEX.
author Bram Moolenaar <bram@vim.org>
date Thu, 19 Jul 2012 11:37:26 +0200
parents d1e4abe8342c
children 8b86b69546a9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 " Vim syntax file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 " Language: Objective C
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 " Maintainer: Kazunobu Kuriyama <kazunobu.kuriyama@nifty.com>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 " Ex-maintainer: Anthony Hodsdon <ahodsdon@fastmail.fm>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 " First Author: Valentino Kyriakides <1kyriaki@informatik.uni-hamburg.de>
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
6 " Last Change: 2012 Apr 30
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 " For version 5.x: Clear all syntax items
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 " For version 6.x: Quit when a syntax file was already loaded
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 syntax clear
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 elseif exists("b:current_syntax")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 finish
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 endif
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
15 let s:keepcpo= &cpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
16 set cpo&vim
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 if &filetype != 'objcpp'
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19 " Read the C syntax to start with
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 if version < 600
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 source <sfile>:p:h/c.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 runtime! syntax/c.vim
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 " Objective C extentions follow below
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29 " NOTE: Objective C is abbreviated to ObjC/objc
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 " and uses *.h, *.m as file extensions!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 " ObjC keywords, types, type qualifiers etc.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 syn keyword objcStatement self super _cmd
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 7
diff changeset
35 syn keyword objcType id Class SEL IMP BOOL
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 syn keyword objcTypeModifier bycopy in out inout oneway
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 7
diff changeset
37 syn keyword objcConstant nil Nil
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 " Match the ObjC #import directive (like C's #include)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 syn region objcImported display contained start=+"+ skip=+\\\\\|\\"+ end=+"+
1121
e63691e7c504 updated for version 7.1a
vimboss
parents: 711
diff changeset
41 syn match objcImported display contained "<[-_0-9a-zA-Z.\/]*>"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 syn match objcImport display "^\s*\(%:\|#\)\s*import\>\s*["<]" contains=objcImported
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 " Match the important ObjC directives
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 syn match objcScopeDecl "@public\|@private\|@protected"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 syn match objcDirective "@interface\|@implementation"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 syn match objcDirective "@class\|@end\|@defs"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 syn match objcDirective "@encode\|@protocol\|@selector"
711
1babf94e0b24 updated for version 7.0214
vimboss
parents: 236
diff changeset
49 syn match objcDirective "@try\|@catch\|@finally\|@throw\|@synchronized"
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 " Match the ObjC method types
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 " NOTE: here I match only the indicators, this looks
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 " much nicer and reduces cluttering color highlightings.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 " However, if you prefer full method declaration matching
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 " append .* at the end of the next two patterns!
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 "
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 syn match objcInstMethod "^\s*-\s*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 syn match objcFactMethod "^\s*+\s*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 " To distinguish from a header inclusion from a protocol list.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 syn match objcProtocol display "<[_a-zA-Z][_a-zA-Z0-9]*>" contains=objcType,cType,Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 " To distinguish labels from the keyword for a method's parameter.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 syn region objcKeyForMethodParam display
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 \ start="^\s*[_a-zA-Z][_a-zA-Z0-9]*\s*:\s*("
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68 \ end=")\s*[_a-zA-Z][_a-zA-Z0-9]*"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 \ contains=objcType,objcTypeModifier,cType,cStructure,cStorageClass,Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 " Objective-C Constant Strings
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 syn match objcSpecial display "%@" contained
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 syn region objcString start=+\(@"\|"\)+ skip=+\\\\\|\\"+ end=+"+ contains=cFormat,cSpecial,objcSpecial
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 " Objective-C Message Expressions
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 syn region objcMessage display start="\[" end="\]" contains=objcMessage,objcStatement,objcType,objcTypeModifier,objcString,objcConstant,objcDirective,cType,cStructure,cStorageClass,cString,cCharacter,cSpecialCharacter,cNumbers,cConstant,cOperator,cComment,cCommentL,Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 syn cluster cParenGroup add=objcMessage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 syn cluster cPreProcGroup add=objcMessage
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 " Define the default highlighting.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 " For version 5.7 and earlier: only when not done already
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 " For version 5.8 and later: only when an item doesn't have highlighting yet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 if version >= 508 || !exists("did_objc_syntax_inits")
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 if version < 508
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 let did_objc_syntax_inits = 1
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 command -nargs=+ HiLink hi link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 command -nargs=+ HiLink hi def link <args>
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 HiLink objcImport Include
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 HiLink objcImported cString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 HiLink objcTypeModifier objcType
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 HiLink objcType Type
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 HiLink objcScopeDecl Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 HiLink objcInstMethod Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 HiLink objcFactMethod Function
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 HiLink objcStatement Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 HiLink objcDirective Statement
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 HiLink objcKeyForMethodParam None
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 HiLink objcString cString
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 HiLink objcSpecial Special
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 HiLink objcProtocol None
236
4707450c2b33 updated for version 7.0066
vimboss
parents: 7
diff changeset
105 HiLink objcConstant cConstant
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 delcommand HiLink
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 endif
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 let b:current_syntax = "objc"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111
3496
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
112 let &cpo = s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
113 unlet s:keepcpo
d1e4abe8342c Fixed compatible mode in most runtime files.
Bram Moolenaar <bram@vim.org>
parents: 1121
diff changeset
114
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 " vim: ts=8