7
|
1 " Vim syntax file
|
|
2 " Language: SNOBOL4
|
|
3 " Maintainer: Rafal Sulejman <rms@poczta.onet.pl>
|
|
4 " Last change: 2004 May 16
|
|
5
|
|
6 " For version 5.x: Clear all syntax items
|
|
7 " For version 6.x: Quit when a syntax file was already loaded
|
|
8 if version < 600
|
|
9 syntax clear
|
|
10 elseif exists("b:current_syntax")
|
|
11 finish
|
|
12 endif
|
|
13
|
|
14 syntax case ignore
|
|
15 " Vanilla Snobol4 keywords
|
|
16 syn keyword snobol4Keywoard any apply arb arbno arg array
|
|
17 syn keyword snobol4Keywoard break
|
|
18 syn keyword snobol4Keywoard char clear code collect convert copy
|
|
19 syn keyword snobol4Keywoard data datatype date define detach differ dump dupl
|
|
20 syn keyword snobol4Keywoard endfile eq eval
|
|
21 syn keyword snobol4Keywoard field
|
|
22 syn keyword snobol4Keywoard ge gt ident
|
|
23 syn keyword snobol4Keywoard input integer item
|
|
24 syn keyword snobol4Keywoard le len lgt local lpad lt
|
|
25 syn keyword snobol4Keywoard ne notany
|
|
26 syn keyword snobol4Keywoard opsyn output
|
|
27 syn keyword snobol4Keywoard pos prototype
|
|
28 syn keyword snobol4Keywoard remdr replace rpad rpos rtab
|
|
29 syn keyword snobol4Keywoard size span stoptr
|
|
30 syn keyword snobol4Keywoard tab table time trace trim
|
|
31 syn keyword snobol4Keywoard unload
|
|
32 syn keyword snobol4Keywoard value
|
|
33 " Spitbol keywords
|
|
34 " CSNOBOL keywords
|
|
35 syn keyword snobol4Keywoard sset
|
|
36
|
|
37 syn region snobol4String matchgroup=Quote start=+"+ skip=+\\"+ end=+"+
|
|
38 syn region snobol4String matchgroup=Quote start=+'+ skip=+\\'+ end=+'+
|
|
39 syn match snobol4Label "^[^- \t][^ \t]*"
|
|
40 syn match snobol4Statement "^-[^ ][^ ]*"
|
|
41 syn match snobol4Comment "^*.*$"
|
|
42 syn match Constant "\.[a-z][a-z0-9\-]*"
|
|
43 "syn match snobol4Label ":\([sf]*([^)]*)\)*" contains=ALLBUT,snobol4ParenError
|
|
44 syn region snobol4Label start=":(" end=")" contains=ALLBUT,snobol4ParenError
|
|
45 syn region snobol4Label start=":f(" end=")" contains=ALLBUT,snobol4ParenError
|
|
46 syn region snobol4Label start=":s(" end=")" contains=ALLBUT,snobol4ParenError
|
|
47 syn match snobol4Number "\<\d*\(\.\d\d*\)*\>"
|
|
48 " Parens matching
|
|
49 syn cluster snobol4ParenGroup contains=snobol4ParenError
|
|
50 syn region snobol4Paren transparent start='(' end=')' contains=ALLBUT,@snobol4ParenGroup,snobol4ErrInBracket
|
|
51 syn match snobol4ParenError display "[\])]"
|
|
52 syn match snobol4ErrInParen display contained "[\]{}]\|<%\|%>"
|
|
53 syn region snobol4Bracket transparent start='\[\|<:' end=']\|:>' contains=ALLBUT,@snobol4ParenGroup,snobol4ErrInParen
|
|
54 syn match snobol4ErrInBracket display contained "[);{}]\|<%\|%>"
|
|
55
|
|
56 " optional shell shebang line
|
|
57 syn match snobol4Comment "^\#\!.*$"
|
|
58
|
|
59
|
|
60 " Define the default highlighting.
|
|
61 " For version 5.7 and earlier: only when not done already
|
|
62 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
63 if version >= 508 || !exists("did_snobol4_syntax_inits")
|
|
64 if version < 508
|
|
65 let did_snobol4_syntax_inits = 1
|
|
66 command -nargs=+ HiLink hi link <args>
|
|
67 else
|
|
68 command -nargs=+ HiLink hi def link <args>
|
|
69 endif
|
|
70
|
|
71 HiLink snobol4Label Label
|
|
72 HiLink snobol4Conditional Conditional
|
|
73 HiLink snobol4Repeat Repeat
|
|
74 HiLink snobol4Number Number
|
|
75 HiLink snobol4Error Error
|
|
76 HiLink snobol4Statement PreProc
|
|
77 HiLink snobol4String String
|
|
78 HiLink snobol4Comment Comment
|
|
79 HiLink snobol4Special Special
|
|
80 HiLink snobol4Todo Todo
|
|
81 HiLink snobol4Keyword Statement
|
|
82 HiLink snobol4Function Statement
|
|
83 HiLink snobol4Keyword Keyword
|
|
84 HiLink snobol4MathsOperator Operator
|
|
85 HiLink snobol4ParenError snobol4Error
|
|
86 HiLink snobol4ErrInParen snobol4Error
|
|
87 HiLink snobol4ErrInBracket snobol4Error
|
|
88
|
|
89 delcommand HiLink
|
|
90 endif
|
|
91
|
|
92 let b:current_syntax = "snobol4"
|
|
93 " vim: ts=8
|