Mercurial > vim
annotate runtime/syntax/pike.vim @ 10682:d564e73ff9ee v8.0.0231
patch 8.0.0231: bracketed paste mode is not tested
commit https://github.com/vim/vim/commit/076e502199b19e6141e4c1e659ff3f21b71934e1
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Jan 24 18:58:30 2017 +0100
patch 8.0.0231: bracketed paste mode is not tested
Problem: There are no tests for bracketed paste mode.
Solution: Add a test. Fix repeating with "normal .".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Tue, 24 Jan 2017 19:00:06 +0100 |
parents | 46763b01cd9a |
children | 371ceeebbdaa |
rev | line source |
---|---|
7 | 1 " Vim syntax file |
2 " Language: Pike | |
3 " Maintainer: Francesco Chemolli <kinkie@kame.usr.dsi.unimi.it> | |
4 " Last Change: 2001 May 10 | |
5 | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
6 " quit when a syntax file was already loaded |
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
7 if exists("b:current_syntax") |
7 | 8 finish |
9 endif | |
10 | |
11 " A bunch of useful C keywords | |
12 syn keyword pikeStatement goto break return continue | |
13 syn keyword pikeLabel case default | |
14 syn keyword pikeConditional if else switch | |
15 syn keyword pikeRepeat while for foreach do | |
16 syn keyword pikeStatement gauge destruct lambda inherit import typeof | |
17 syn keyword pikeException catch | |
18 syn keyword pikeType inline nomask private protected public static | |
19 | |
20 | |
21 syn keyword pikeTodo contained TODO FIXME XXX | |
22 | |
23 " String and Character constants | |
24 " Highlight special characters (those which have a backslash) differently | |
25 syn match pikeSpecial contained "\\[0-7][0-7][0-7]\=\|\\." | |
26 syn region pikeString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=pikeSpecial | |
27 syn match pikeCharacter "'[^\\]'" | |
28 syn match pikeSpecialCharacter "'\\.'" | |
29 syn match pikeSpecialCharacter "'\\[0-7][0-7]'" | |
30 syn match pikeSpecialCharacter "'\\[0-7][0-7][0-7]'" | |
31 | |
32 " Compound data types | |
33 syn region pikeCompoundType start='({' contains=pikeString,pikeCompoundType,pikeNumber,pikeFloat end='})' | |
34 syn region pikeCompoundType start='(\[' contains=pikeString,pikeCompoundType,pikeNumber,pikeFloat end='\])' | |
35 syn region pikeCompoundType start='(<' contains=pikeString,pikeCompoundType,pikeNumber,pikeFloat end='>)' | |
36 | |
37 "catch errors caused by wrong parenthesis | |
38 syn region pikeParen transparent start='([^{[<(]' end=')' contains=ALLBUT,pikeParenError,pikeIncluded,pikeSpecial,pikeTodo,pikeUserLabel,pikeBitField | |
39 syn match pikeParenError ")" | |
40 syn match pikeInParen contained "[^(][{}][^)]" | |
41 | |
42 "integer number, or floating point number without a dot and with "f". | |
43 syn case ignore | |
44 syn match pikeNumber "\<\d\+\(u\=l\=\|lu\|f\)\>" | |
45 "floating point number, with dot, optional exponent | |
46 syn match pikeFloat "\<\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\=\>" | |
47 "floating point number, starting with a dot, optional exponent | |
48 syn match pikeFloat "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>" | |
49 "floating point number, without dot, with exponent | |
50 syn match pikeFloat "\<\d\+e[-+]\=\d\+[fl]\=\>" | |
51 "hex number | |
52 syn match pikeNumber "\<0x[0-9a-f]\+\(u\=l\=\|lu\)\>" | |
53 "syn match pikeIdentifier "\<[a-z_][a-z0-9_]*\>" | |
54 syn case match | |
55 " flag an octal number with wrong digits | |
56 syn match pikeOctalError "\<0[0-7]*[89]" | |
57 | |
58 if exists("c_comment_strings") | |
59 " A comment can contain pikeString, pikeCharacter and pikeNumber. | |
60 " But a "*/" inside a pikeString in a pikeComment DOES end the comment! So we | |
61 " need to use a special type of pikeString: pikeCommentString, which also ends on | |
62 " "*/", and sees a "*" at the start of the line as comment again. | |
63 " Unfortunately this doesn't very well work for // type of comments :-( | |
64 syntax match pikeCommentSkip contained "^\s*\*\($\|\s\+\)" | |
65 syntax region pikeCommentString contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end=+\*/+me=s-1 contains=pikeSpecial,pikeCommentSkip | |
66 syntax region pikeComment2String contained start=+"+ skip=+\\\\\|\\"+ end=+"+ end="$" contains=pikeSpecial | |
67 syntax region pikeComment start="/\*" end="\*/" contains=pikeTodo,pikeCommentString,pikeCharacter,pikeNumber,pikeFloat | |
68 syntax match pikeComment "//.*" contains=pikeTodo,pikeComment2String,pikeCharacter,pikeNumber | |
69 syntax match pikeComment "#\!.*" contains=pikeTodo,pikeComment2String,pikeCharacter,pikeNumber | |
70 else | |
71 syn region pikeComment start="/\*" end="\*/" contains=pikeTodo | |
72 syn match pikeComment "//.*" contains=pikeTodo | |
73 syn match pikeComment "#!.*" contains=pikeTodo | |
74 endif | |
75 syntax match pikeCommentError "\*/" | |
76 | |
77 syn keyword pikeOperator sizeof | |
78 syn keyword pikeType int string void float mapping array multiset mixed | |
79 syn keyword pikeType program object function | |
80 | |
81 syn region pikePreCondit start="^\s*#\s*\(if\>\|ifdef\>\|ifndef\>\|elif\>\|else\>\|endif\>\)" skip="\\$" end="$" contains=pikeComment,pikeString,pikeCharacter,pikeNumber,pikeCommentError | |
82 syn region pikeIncluded contained start=+"+ skip=+\\\\\|\\"+ end=+"+ | |
83 syn match pikeIncluded contained "<[^>]*>" | |
84 syn match pikeInclude "^\s*#\s*include\>\s*["<]" contains=pikeIncluded | |
85 "syn match pikeLineSkip "\\$" | |
86 syn region pikeDefine start="^\s*#\s*\(define\>\|undef\>\)" skip="\\$" end="$" contains=ALLBUT,pikePreCondit,pikeIncluded,pikeInclude,pikeDefine,pikeInParen | |
87 syn region pikePreProc start="^\s*#\s*\(pragma\>\|line\>\|warning\>\|warn\>\|error\>\)" skip="\\$" end="$" contains=ALLBUT,pikePreCondit,pikeIncluded,pikeInclude,pikeDefine,pikeInParen | |
88 | |
89 " Highlight User Labels | |
90 syn region pikeMulti transparent start='?' end=':' contains=ALLBUT,pikeIncluded,pikeSpecial,pikeTodo,pikeUserLabel,pikeBitField | |
91 " Avoid matching foo::bar() in C++ by requiring that the next char is not ':' | |
92 syn match pikeUserLabel "^\s*\I\i*\s*:$" | |
93 syn match pikeUserLabel ";\s*\I\i*\s*:$"ms=s+1 | |
94 syn match pikeUserLabel "^\s*\I\i*\s*:[^:]"me=e-1 | |
95 syn match pikeUserLabel ";\s*\I\i*\s*:[^:]"ms=s+1,me=e-1 | |
96 | |
97 " Avoid recognizing most bitfields as labels | |
98 syn match pikeBitField "^\s*\I\i*\s*:\s*[1-9]"me=e-1 | |
99 syn match pikeBitField ";\s*\I\i*\s*:\s*[1-9]"me=e-1 | |
100 | |
101 syn sync ccomment pikeComment minlines=10 | |
102 | |
103 " Define the default highlighting. | |
10048
43efa4f5a8ea
commit https://github.com/vim/vim/commit/89bcfda6834aba724d12554a34b9ed49f5789fd5
Christian Brabandt <cb@256bit.org>
parents:
7
diff
changeset
|
104 " Only when an item doesn't have highlighting yet |
7 | 105 |
10051
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
106 hi def link pikeLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
107 hi def link pikeUserLabel Label |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
108 hi def link pikeConditional Conditional |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
109 hi def link pikeRepeat Repeat |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
110 hi def link pikeCharacter Character |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
111 hi def link pikeSpecialCharacter pikeSpecial |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
112 hi def link pikeNumber Number |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
113 hi def link pikeFloat Float |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
114 hi def link pikeOctalError pikeError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
115 hi def link pikeParenError pikeError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
116 hi def link pikeInParen pikeError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
117 hi def link pikeCommentError pikeError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
118 hi def link pikeOperator Operator |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
119 hi def link pikeInclude Include |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
120 hi def link pikePreProc PreProc |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
121 hi def link pikeDefine Macro |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
122 hi def link pikeIncluded pikeString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
123 hi def link pikeError Error |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
124 hi def link pikeStatement Statement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
125 hi def link pikePreCondit PreCondit |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
126 hi def link pikeType Type |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
127 hi def link pikeCommentError pikeError |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
128 hi def link pikeCommentString pikeString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
129 hi def link pikeComment2String pikeString |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
130 hi def link pikeCommentSkip pikeComment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
131 hi def link pikeString String |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
132 hi def link pikeComment Comment |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
133 hi def link pikeSpecial SpecialChar |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
134 hi def link pikeTodo Todo |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
135 hi def link pikeException pikeStatement |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
136 hi def link pikeCompoundType Constant |
46763b01cd9a
commit https://github.com/vim/vim/commit/f37506f60f87d52a9e8850e30067645e2b13783c
Christian Brabandt <cb@256bit.org>
parents:
10048
diff
changeset
|
137 "hi def link pikeIdentifier Identifier |
7 | 138 |
139 | |
140 let b:current_syntax = "pike" | |
141 | |
142 " vim: ts=8 |