annotate runtime/syntax/racc.vim @ 2904:c249d9aa60f7 v7.3.225

updated for version 7.3.225 Problem: Using "\n" in a substitute inside ":s" does not result in a line break. Solution: Change behavior inside vim_regexec_nl(). Add tests. (Motoya Kurotsu)
author Bram Moolenaar <bram@vim.org>
date Sun, 19 Jun 2011 04:32:15 +0200
parents f4f8014d516e
children 1218c5353e2b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
1 " Vim default file
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
2 " Language: Racc input file
839
1f3b1021f002 updated for version 7.0e05
vimboss
parents: 389
diff changeset
3 " Maintainer: Nikolai Weibull <now@bitwi.se>
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1204
diff changeset
4 " Latest Revision: 2008-06-22
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
5
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
6 if exists("b:current_syntax")
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
7 finish
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
8 endif
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
9
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
10 let s:cpo_save = &cpo
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
11 set cpo&vim
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
12
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
13 syn keyword raccTodo contained TODO FIXME XXX NOTE
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
14
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
15 syn region raccComment start='/\*' end='\*/'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
16 \ contains=raccTodo,@Spell
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
17 syn region raccComment display oneline start='#' end='$'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
18 \ contains=raccTodo,@Spell
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
19
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
20 syn region raccClass transparent matchgroup=raccKeyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
21 \ start='\<class\>' end='\<rule\>'he=e-4
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
22 \ contains=raccComment,raccPrecedence,
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
23 \ raccTokenDecl,raccExpect,raccOptions,raccConvert,
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
24 \ raccStart,
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
25
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
26 syn region raccPrecedence transparent matchgroup=raccKeyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
27 \ start='\<prechigh\>' end='\<preclow\>'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
28 \ contains=raccComment,raccPrecSpec
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
29
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
30 syn keyword raccPrecSpec contained nonassoc left right
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
31 \ nextgroup=raccPrecToken,raccPrecString skipwhite
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
32 \ skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
33
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1204
diff changeset
34 syn match raccPrecToken contained '\<\u[A-Z0-9_]*\>'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
35 \ nextgroup=raccPrecToken,raccPrecString skipwhite
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
36 \ skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
37
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
38 syn region raccPrecString matchgroup=raccPrecString start=+"+
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
39 \ skip=+\\\\\|\\"+ end=+"+
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
40 \ contains=raccSpecial
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
41 \ nextgroup=raccPrecToken,raccPrecString skipwhite
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
42 \ skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
43 syn region raccPrecString matchgroup=raccPrecString start=+'+
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
44 \ skip=+\\\\\|\\'+ end=+'+ contains=raccSpecial
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
45 \ nextgroup=raccPrecToken,raccPrecString skipwhite
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
46 \ skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
47
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
48 syn keyword raccTokenDecl contained token
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
49 \ nextgroup=raccTokenR skipwhite skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
50
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1204
diff changeset
51 syn match raccTokenR contained '\<\u[A-Z0-9_]*\>'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
52 \ nextgroup=raccTokenR skipwhite skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
53
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
54 syn keyword raccExpect contained expect
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
55 \ nextgroup=raccNumber skipwhite skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
56
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
57 syn match raccNumber contained '\<\d\+\>'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
58
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
59 syn keyword raccOptions contained options
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
60 \ nextgroup=raccOptionsR skipwhite skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
61
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
62 syn keyword raccOptionsR contained omit_action_call result_var
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
63 \ nextgroup=raccOptionsR skipwhite skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
64
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
65 syn region raccConvert transparent contained matchgroup=raccKeyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
66 \ start='\<convert\>' end='\<end\>'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
67 \ contains=raccComment,raccConvToken skipwhite
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
68 \ skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
69
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1204
diff changeset
70 syn match raccConvToken contained '\<\u[A-Z0-9_]*\>'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
71 \ nextgroup=raccString skipwhite skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
72
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
73 syn keyword raccStart contained start
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
74 \ nextgroup=raccTargetS skipwhite skipnl
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
75
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1204
diff changeset
76 syn match raccTargetS contained '\<\l[a-z0-9_]*\>'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
77
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
78 syn match raccSpecial contained '\\["'\\]'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
79
389
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
80 syn region raccString start=+"+ skip=+\\\\\|\\"+ end=+"+
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
81 \ contains=raccSpecial
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
82 syn region raccString start=+'+ skip=+\\\\\|\\'+ end=+'+
4fe8e1a7758e updated for version 7.0102
vimboss
parents: 375
diff changeset
83 \ contains=raccSpecial
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
84
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
85 syn region raccRules transparent matchgroup=raccKeyword start='\<rule\>'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
86 \ end='\<end\>' contains=raccComment,raccString,
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
87 \ raccNumber,raccToken,raccTarget,raccDelimiter,
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
88 \ raccAction
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
89
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1204
diff changeset
90 syn match raccTarget contained '\<\l[a-z0-9_]*\>'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
91
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
92 syn match raccDelimiter contained '[:|]'
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
93
1698
f4f8014d516e updated for version 7.2c-000
vimboss
parents: 1204
diff changeset
94 syn match raccToken contained '\<\u[A-Z0-9_]*\>'
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
95
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
96 syn include @raccRuby syntax/ruby.vim
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
97
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
98 syn region raccAction transparent matchgroup=raccDelimiter
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
99 \ start='{' end='}' contains=@raccRuby
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
100
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
101 syn region raccHeader transparent matchgroup=raccPreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
102 \ start='^---- header.*' end='^----'he=e-4
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
103 \ contains=@raccRuby
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
104
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
105 syn region raccInner transparent matchgroup=raccPreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
106 \ start='^---- inner.*' end='^----'he=e-4
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
107 \ contains=@raccRuby
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
108
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
109 syn region raccFooter transparent matchgroup=raccPreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
110 \ start='^---- footer.*' end='^----'he=e-4
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
111 \ contains=@raccRuby
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
112
1204
a3c21128b246 updated for version 7.1b
vimboss
parents: 839
diff changeset
113 syn sync match raccSyncHeader grouphere raccHeader '^---- header'
a3c21128b246 updated for version 7.1b
vimboss
parents: 839
diff changeset
114 syn sync match raccSyncInner grouphere raccInner '^---- inner'
a3c21128b246 updated for version 7.1b
vimboss
parents: 839
diff changeset
115 syn sync match raccSyncFooter grouphere raccFooter '^---- footer'
a3c21128b246 updated for version 7.1b
vimboss
parents: 839
diff changeset
116
375
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
117 hi def link raccTodo Todo
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
118 hi def link raccComment Comment
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
119 hi def link raccPrecSpec Type
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
120 hi def link raccPrecToken raccToken
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
121 hi def link raccPrecString raccString
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
122 hi def link raccTokenDecl Keyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
123 hi def link raccToken Identifier
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
124 hi def link raccTokenR raccToken
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
125 hi def link raccExpect Keyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
126 hi def link raccNumber Number
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
127 hi def link raccOptions Keyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
128 hi def link raccOptionsR Identifier
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
129 hi def link raccConvToken raccToken
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
130 hi def link raccStart Keyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
131 hi def link raccTargetS Type
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
132 hi def link raccSpecial special
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
133 hi def link raccString String
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
134 hi def link raccTarget Type
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
135 hi def link raccDelimiter Delimiter
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
136 hi def link raccPreProc PreProc
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
137 hi def link raccKeyword Keyword
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
138
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
139 let b:current_syntax = "racc"
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
140
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
141 let &cpo = s:cpo_save
f14cbd913415 updated for version 7.0097
vimboss
parents:
diff changeset
142 unlet s:cpo_save