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