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