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