375
|
1 " Vim default file
|
|
2 " Language: Racc input file
|
|
3 " Maintainer: Nikolai Weibull <nikolai+work.vim@bitwi.se>
|
|
4 " Latest Revision: 2005-06-29
|
|
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
|
|
15 syn region raccComment matchgroup=raccComment start='/\*' end='\*/'
|
|
16 \ contains=raccTodo,@Spell
|
|
17 syn region raccComment matchgroup=raccComment start='#' end='$'
|
|
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
|
|
34 syn match raccPrecToken contained '\<\u[A-Z0-9]*\>'
|
|
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
|
|
51 syn match raccTokenR contained '\<\u[A-Z0-9]*\>'
|
|
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
|
|
70 syn match raccConvToken contained '\<\u[A-Z0-9]*\>'
|
|
71 \ nextgroup=raccString skipwhite skipnl
|
|
72
|
|
73 syn keyword raccStart contained start
|
|
74 \ nextgroup=raccTargetS skipwhite skipnl
|
|
75
|
|
76 syn match raccTargetS contained '\<\l[a-z0-9]*\>'
|
|
77
|
|
78 syn match raccSpecial contained '\\["'\\]'
|
|
79
|
|
80 syn region raccString matchgroup=raccString start=+"+ skip=+\\\\\|\\"+
|
|
81 \ end=+"+ contains=raccSpecial
|
|
82 syn region raccString matchgroup=raccString start=+'+ skip=+\\\\\|\\'+
|
|
83 \ end=+'+ contains=raccSpecial
|
|
84
|
|
85 syn region raccRules transparent matchgroup=raccKeyword start='\<rule\>'
|
|
86 \ end='\<end\>' contains=raccComment,raccString,
|
|
87 \ raccNumber,raccToken,raccTarget,raccDelimiter,
|
|
88 \ raccAction
|
|
89
|
|
90 syn match raccTarget contained '\<\l[a-z0-9]*\>'
|
|
91
|
|
92 syn match raccDelimiter contained '[:|]'
|
|
93
|
|
94 syn match raccToken contained '\<\u[A-Z0-9]*\>'
|
|
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
|
|
113 hi def link raccTodo Todo
|
|
114 hi def link raccComment Comment
|
|
115 hi def link raccPrecSpec Type
|
|
116 hi def link raccPrecToken raccToken
|
|
117 hi def link raccPrecString raccString
|
|
118 hi def link raccTokenDecl Keyword
|
|
119 hi def link raccToken Identifier
|
|
120 hi def link raccTokenR raccToken
|
|
121 hi def link raccExpect Keyword
|
|
122 hi def link raccNumber Number
|
|
123 hi def link raccOptions Keyword
|
|
124 hi def link raccOptionsR Identifier
|
|
125 hi def link raccConvToken raccToken
|
|
126 hi def link raccStart Keyword
|
|
127 hi def link raccTargetS Type
|
|
128 hi def link raccSpecial special
|
|
129 hi def link raccString String
|
|
130 hi def link raccTarget Type
|
|
131 hi def link raccDelimiter Delimiter
|
|
132 hi def link raccPreProc PreProc
|
|
133 hi def link raccKeyword Keyword
|
|
134
|
|
135 let b:current_syntax = "racc"
|
|
136
|
|
137 let &cpo = s:cpo_save
|
|
138 unlet s:cpo_save
|