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