comparison runtime/syntax/forth.vim @ 1620:73fe8baea242

updated for version 7.2a
author vimboss
date Tue, 24 Jun 2008 21:16:56 +0000
parents 631143ac4a01
children f4f8014d516e
comparison
equal deleted inserted replaced
1619:b9740fb41986 1620:73fe8baea242
1 " Vim syntax file 1 " Vim syntax file
2 " Language: FORTH 2 " Language: FORTH
3 " Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de> 3 " Maintainer: Christian V. J. Brüssow <cvjb@cvjb.de>
4 " Last Change: Di 06 Jul 2004 18:40:33 CEST 4 " Last Change: Sa 14 Jul 2007 21:39:53 CEST
5 " Filenames: *.fs,*.ft 5 " Filenames: *.fs,*.ft
6 " URL: http://www.cvjb.de/comp/vim/forth.vim 6 " URL: http://www.cvjb.de/comp/vim/forth.vim
7 7
8 " $Id$ 8 " $Id$
9 9
10 " The list of keywords is incomplete, compared with the offical ANS 10 " The list of keywords is incomplete, compared with the offical ANS
11 " wordlist. If you use this language, please improve it, and send me 11 " wordlist. If you use this language, please improve it, and send me
12 " the patches. 12 " the patches.
13 13
14 " Many Thanks to... 14 " Many Thanks to...
15 " 15 "
16 " 2004-07-06: 16 " 2007-07-11:
17 " Changed "syn sync ccomment maxlines=200" line: splitted it into two separate 17 " Benjamin Krill <ben at codiert dot org> send me a patch
18 " lines. 18 " to highlight space errors.
19 " 19 " You can toggle this feature on through setting the
20 " flag forth_space_errors in you vimrc. If you have switched it on,
21 " you can turn off highlighting of trailing spaces in comments by
22 " setting forth_no_trail_space_error in your vimrc. If you do not want
23 " the highlighting of a tabulator following a space in comments, you
24 " can turn this off by setting forth_no_tab_space_error.
25 "
26 " 2006-05-25:
27 " Bill McCarthy <WJMc@...> and Ilya Sher <ilya-vim@...>
28 " Who found a bug in the ccomment line in 2004!!!
29 " I'm really very sorry, that it has taken two years to fix that
30 " in the offical version of this file. Shame on me.
31 " I think my face will be red the next ten years...
32 "
33 " 2006-05-21:
34 " Thomas E. Vaughan <tevaugha at ball dot com> send me a patch
35 " for the parenthesis comment word, so words with a trailing
36 " parenthesis will not start the highlighting for such comments.
37 "
20 " 2003-05-10: 38 " 2003-05-10:
21 " Andrew Gaul <andrew at gaul.org> send me a patch for 39 " Andrew Gaul <andrew at gaul.org> send me a patch for
22 " forthOperators. 40 " forthOperators.
23 " 41 "
24 " 2003-04-03: 42 " 2003-04-03:
25 " Ron Aaron <ronaharon at yahoo.com> made updates for an 43 " Ron Aaron <ron at ronware dot org> made updates for an
26 " improved Win32Forth support. 44 " improved Win32Forth support.
27 " 45 "
28 " 2002-04-22: 46 " 2002-04-22:
29 " Charles Shattuck <charley at forth.org> helped me to settle up with the 47 " Charles Shattuck <charley at forth dot org> helped me to settle up with the
30 " binary and hex number highlighting. 48 " binary and hex number highlighting.
31 " 49 "
32 " 2002-04-20: 50 " 2002-04-20:
33 " Charles Shattuck <charley at forth.org> send me some code for correctly 51 " Charles Shattuck <charley at forth dot org> send me some code for correctly
34 " highlighting char and [char] followed by an opening paren. He also added 52 " highlighting char and [char] followed by an opening paren. He also added
35 " some words for operators, conditionals, and definitions; and added the 53 " some words for operators, conditionals, and definitions; and added the
36 " highlighting for s" and c". 54 " highlighting for s" and c".
37 " 55 "
38 " 2000-03-28: 56 " 2000-03-28:
39 " John Providenza <john at probo.com> made improvements for the 57 " John Providenza <john at probo dot com> made improvements for the
40 " highlighting of strings, and added the code for highlighting hex numbers. 58 " highlighting of strings, and added the code for highlighting hex numbers.
41 " 59 "
42 60
43 61
44 " For version 5.x: Clear all syntax items 62 " For version 5.x: Clear all syntax items
66 setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 84 setlocal iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
67 else 85 else
68 set iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255 86 set iskeyword=!,@,33-35,%,$,38-64,A-Z,91-96,a-z,123-126,128-255
69 endif 87 endif
70 88
89 " when wanted, highlight trailing white space
90 if exists("forth_space_errors")
91 if !exists("forth_no_trail_space_error")
92 syn match forthSpaceError display excludenl "\s\+$"
93 endif
94 if !exists("forth_no_tab_space_error")
95 syn match forthSpaceError display " \+\t"me=e-1
96 endif
97 endif
71 98
72 " Keywords 99 " Keywords
73 100
74 " basic mathematical and logical operators 101 " basic mathematical and logical operators
75 syn keyword forthOperators + - * / MOD /MOD NEGATE ABS MIN MAX 102 syn keyword forthOperators + - * / MOD /MOD NEGATE ABS MIN MAX
175 " XXX 202 " XXX
176 syn region forthString start=+s\"+ end=+"+ end=+$+ 203 syn region forthString start=+s\"+ end=+"+ end=+$+
177 syn region forthString start=+c\"+ end=+"+ end=+$+ 204 syn region forthString start=+c\"+ end=+"+ end=+$+
178 205
179 " Comments 206 " Comments
180 syn match forthComment '\\\s.*$' contains=forthTodo 207 syn match forthComment '\\\s.*$' contains=forthTodo,forthSpaceError
181 syn region forthComment start='\\S\s' end='.*' contains=forthTodo 208 syn region forthComment start='\\S\s' end='.*' contains=forthTodo,forthSpaceError
182 syn match forthComment '\.(\s[^)]*)' contains=forthTodo 209 syn match forthComment '\.(\s[^)]*)' contains=forthTodo,forthSpaceError
183 syn region forthComment start='(\s' skip='\\)' end=')' contains=forthTodo 210 syn region forthComment start='\s(\s' skip='\\)' end=')' contains=forthTodo,forthSpaceError
184 syn region forthComment start='/\*' end='\*/' contains=forthTodo 211 syn region forthComment start='/\*' end='\*/' contains=forthTodo,forthSpaceError
185 "syn match forthComment '(\s[^\-]*\-\-[^\-]*)' contains=forthTodo
186 212
187 " Include files 213 " Include files
188 syn match forthInclude '^INCLUDE\s\+\k\+' 214 syn match forthInclude '^INCLUDE\s\+\k\+'
189 syn match forthInclude '^fload\s\+' 215 syn match forthInclude '^fload\s\+'
190 syn match forthInclude '^needs\s\+' 216 syn match forthInclude '^needs\s\+'
192 " Define the default highlighting. 218 " Define the default highlighting.
193 " For version 5.7 and earlier: only when not done already 219 " For version 5.7 and earlier: only when not done already
194 " For version 5.8 and later: only when an item doesn't have highlighting yet 220 " For version 5.8 and later: only when an item doesn't have highlighting yet
195 if version >= 508 || !exists("did_forth_syn_inits") 221 if version >= 508 || !exists("did_forth_syn_inits")
196 if version < 508 222 if version < 508
197 let did_forth_syn_inits = 1 223 let did_forth_syn_inits = 1
198 command -nargs=+ HiLink hi link <args> 224 command -nargs=+ HiLink hi link <args>
199 else 225 else
200 command -nargs=+ HiLink hi def link <args> 226 command -nargs=+ HiLink hi def link <args>
201 endif 227 endif
202 228
203 " The default methods for highlighting. Can be overriden later. 229 " The default methods for highlighting. Can be overriden later.
204 HiLink forthTodo Todo 230 HiLink forthTodo Todo
205 HiLink forthOperators Operator 231 HiLink forthOperators Operator
229 HiLink forthClassDef Define 255 HiLink forthClassDef Define
230 HiLink forthEndOfClassDef Define 256 HiLink forthEndOfClassDef Define
231 HiLink forthObjectDef Define 257 HiLink forthObjectDef Define
232 HiLink forthEndOfObjectDef Define 258 HiLink forthEndOfObjectDef Define
233 HiLink forthInclude Include 259 HiLink forthInclude Include
260 HiLink forthSpaceError Error
234 261
235 delcommand HiLink 262 delcommand HiLink
236 endif 263 endif
237 264
238 let b:current_syntax = "forth" 265 let b:current_syntax = "forth"