7
|
1 " Vim syntax file
|
|
2 " Language: SNOBOL4
|
|
3 " Maintainer: Rafal Sulejman <rms@poczta.onet.pl>
|
857
|
4 " Site: http://rms.republika.pl/vim/syntax/snobol4.vim
|
1624
|
5 " Last change: 2006 may 10
|
857
|
6 " Changes:
|
1624
|
7 " - strict snobol4 mode (set snobol4_strict_mode to activate)
|
|
8 " - incorrect HL of dots in strings corrected
|
|
9 " - incorrect HL of dot-variables in parens corrected
|
|
10 " - one character labels weren't displayed correctly.
|
857
|
11 " - nonexistent Snobol4 keywords displayed as errors.
|
7
|
12
|
|
13 " For version 5.x: Clear all syntax items
|
|
14 " For version 6.x: Quit when a syntax file was already loaded
|
|
15 if version < 600
|
|
16 syntax clear
|
|
17 elseif exists("b:current_syntax")
|
|
18 finish
|
|
19 endif
|
|
20
|
|
21 syntax case ignore
|
1624
|
22
|
|
23 " Snobol4 keywords
|
|
24 syn keyword snobol4Keyword any apply arb arbno arg array
|
|
25 syn keyword snobol4Keyword break
|
|
26 syn keyword snobol4Keyword char clear code collect convert copy
|
|
27 syn keyword snobol4Keyword data datatype date define detach differ dump dupl
|
|
28 syn keyword snobol4Keyword endfile eq eval
|
|
29 syn keyword snobol4Keyword field
|
|
30 syn keyword snobol4Keyword ge gt ident
|
|
31 syn keyword snobol4Keyword input integer item
|
|
32 syn keyword snobol4Keyword le len lgt local lpad lt
|
|
33 syn keyword snobol4Keyword ne notany
|
|
34 syn keyword snobol4Keyword opsyn output
|
|
35 syn keyword snobol4Keyword pos prototype
|
|
36 syn keyword snobol4Keyword remdr replace rpad rpos rtab rewind
|
|
37 syn keyword snobol4Keyword size span stoptr
|
|
38 syn keyword snobol4Keyword tab table time trace trim terminal
|
|
39 syn keyword snobol4Keyword unload
|
|
40 syn keyword snobol4Keyword value
|
|
41
|
7
|
42 " CSNOBOL keywords
|
1624
|
43 syn keyword snobol4ExtKeyword breakx
|
|
44 syn keyword snobol4ExtKeyword char chop
|
|
45 syn keyword snobol4ExtKeyword date delete
|
|
46 syn keyword snobol4ExtKeyword exp
|
|
47 syn keyword snobol4ExtKeyword freeze function
|
|
48 syn keyword snobol4ExtKeyword host
|
|
49 syn keyword snobol4ExtKeyword io_findunit
|
|
50 syn keyword snobol4ExtKeyword label lpad leq lge lle llt lne log
|
|
51 syn keyword snobol4ExtKeyword ord
|
|
52 syn keyword snobol4ExtKeyword reverse rpad rsort rename
|
|
53 syn keyword snobol4ExtKeyword serv_listen sset set sort sqrt substr
|
|
54 syn keyword snobol4ExtKeyword thaw
|
|
55 syn keyword snobol4ExtKeyword vdiffer
|
7
|
56
|
1624
|
57 syn region snobol4String matchgroup=Quote start=+"+ end=+"+
|
|
58 syn region snobol4String matchgroup=Quote start=+'+ end=+'+
|
|
59 syn match snobol4BogusStatement "^-[^ ][^ ]*"
|
|
60 syn match snobol4Statement "^-\(include\|copy\|module\|line\|plusopts\|case\|error\|noerrors\|list\|unlist\|execute\|noexecute\|copy\)"
|
|
61 syn match snobol4Constant /"[^a-z"']\.[a-z][a-z0-9\-]*"/hs=s+1
|
|
62 syn region snobol4Goto start=":[sf]\{0,1}(" end=")\|$\|;" contains=ALLBUT,snobol4ParenError
|
857
|
63 syn match snobol4Number "\<\d*\(\.\d\d*\)*\>"
|
1624
|
64 syn match snobol4BogusSysVar "&\w\{1,}"
|
857
|
65 syn match snobol4SysVar "&\(abort\|alphabet\|anchor\|arb\|bal\|case\|code\|dump\|errlimit\|errtext\|errtype\|fail\|fence\|fnclevel\|ftrace\|fullscan\|input\|lastno\|lcase\|maxlngth\|output\|parm\|rem\|rtntype\|stcount\|stfcount\|stlimit\|stno\|succeed\|trace\|trim\|ucase\)"
|
1624
|
66 syn match snobol4ExtSysVar "&\(gtrace\|line\|file\|lastline\|lastfile\)"
|
|
67 syn match snobol4Label "\(^\|;\)[^-\.\+ \t\*\.]\{1,}[^ \t\*\;]*"
|
|
68 syn match snobol4Comment "\(^\|;\)\([\*\|!;#].*$\)"
|
|
69
|
7
|
70 " Parens matching
|
|
71 syn cluster snobol4ParenGroup contains=snobol4ParenError
|
|
72 syn region snobol4Paren transparent start='(' end=')' contains=ALLBUT,@snobol4ParenGroup,snobol4ErrInBracket
|
|
73 syn match snobol4ParenError display "[\])]"
|
|
74 syn match snobol4ErrInParen display contained "[\]{}]\|<%\|%>"
|
|
75 syn region snobol4Bracket transparent start='\[\|<:' end=']\|:>' contains=ALLBUT,@snobol4ParenGroup,snobol4ErrInParen
|
857
|
76 syn match snobol4ErrInBracket display contained "[){}]\|<%\|%>"
|
7
|
77
|
|
78 " optional shell shebang line
|
1624
|
79 " syn match snobol4Comment "^\#\!.*$"
|
7
|
80
|
|
81 " Define the default highlighting.
|
|
82 " For version 5.7 and earlier: only when not done already
|
|
83 " For version 5.8 and later: only when an item doesn't have highlighting yet
|
|
84 if version >= 508 || !exists("did_snobol4_syntax_inits")
|
|
85 if version < 508
|
|
86 let did_snobol4_syntax_inits = 1
|
|
87 command -nargs=+ HiLink hi link <args>
|
|
88 else
|
|
89 command -nargs=+ HiLink hi def link <args>
|
|
90 endif
|
|
91
|
857
|
92 HiLink snobol4Constant Constant
|
|
93 HiLink snobol4Label Label
|
|
94 HiLink snobol4Goto Repeat
|
|
95 HiLink snobol4Conditional Conditional
|
|
96 HiLink snobol4Repeat Repeat
|
|
97 HiLink snobol4Number Number
|
|
98 HiLink snobol4Error Error
|
|
99 HiLink snobol4Statement PreProc
|
1624
|
100 HiLink snobol4BogusStatement snobol4Error
|
857
|
101 HiLink snobol4String String
|
|
102 HiLink snobol4Comment Comment
|
|
103 HiLink snobol4Special Special
|
|
104 HiLink snobol4Todo Todo
|
|
105 HiLink snobol4Keyword Keyword
|
1624
|
106 HiLink snobol4Function Function
|
857
|
107 HiLink snobol4MathsOperator Operator
|
7
|
108 HiLink snobol4ParenError snobol4Error
|
|
109 HiLink snobol4ErrInParen snobol4Error
|
|
110 HiLink snobol4ErrInBracket snobol4Error
|
857
|
111 HiLink snobol4SysVar Keyword
|
|
112 HiLink snobol4BogusSysVar snobol4Error
|
1624
|
113 if exists("snobol4_strict_mode")
|
|
114 HiLink snobol4ExtSysVar WarningMsg
|
|
115 HiLink snobol4ExtKeyword WarningMsg
|
|
116 else
|
|
117 HiLink snobol4ExtSysVar snobol4SysVar
|
|
118 HiLink snobol4ExtKeyword snobol4Keyword
|
|
119 endif
|
7
|
120
|
|
121 delcommand HiLink
|
|
122 endif
|
|
123
|
|
124 let b:current_syntax = "snobol4"
|
|
125 " vim: ts=8
|