xref: /inferno-os/lib/limbo.vim (revision 1aff7a0a7dab24c5871eb95737c86616c9fd848b)
1" Vim syntax file
2" Language:     Limbo
3" Maintainer:   Alex Efros <powerman-asdf@ya.ru>
4" Version:	0.5
5" Updated:      2008-10-17
6
7" Remove any old syntax stuff that was loaded (5.x) or quit when a syntax file
8" was already loaded (6.x).
9if version < 600
10  syntax clear
11elseif exists("b:current_syntax")
12  finish
13endif
14
15syn keyword	lTodo		TODO TBD FIXME XXX BUG contained
16syn match	lComment	"#.*" contains=@Spell,lTodo
17
18syn keyword	lInclude	include
19
20syn match	lSpecialChar	display contained "\\\(u\x\{4}\|['\"\\tnrbavf0]\)"
21syn match	lSpecialError	display contained "\(\\[^'\"\\tnrbavf0u]\+\|\\u.\{0,3}\X\)"
22syn match	lCharError	display contained "\([^\\'][^']\+\|\\[^'][^']\+\)"
23syn region	lString		start=+"+ end=+"+ skip=+\\"+ contains=@Spell,lSpecialChar,lSpecialError
24syn region	lCharacter	start=+'+ end=+'+ skip=+\\'+ contains=lSpecialChar,lSpecialError,lCharError
25
26syn keyword	lSpecial	nil iota
27
28syn keyword	lFunction	tl hd len tagof
29syn match	lFunction	"<-=\?"
30
31syn keyword	lStatement	alt break continue exit return spawn implement import load raise
32syn keyword 	lRepeat		for while do
33syn keyword	lConditional	if else case
34
35syn keyword	lType		array big byte chan con int list real string fn fixed
36syn keyword	lStructure	adt pick module
37syn keyword	lStorageClass	ref self cyclic type of
38
39syn keyword	lDelimiter	or to
40syn match	lDelimiter	"=>\|->\|\.\|::"
41
42
43if version >= 508 || !exists("did_icgiperl_syn_inits")
44  if version < 508
45    let did_icgiperl_syn_inits = 1
46    command -nargs=+ HiLink hi link <args>
47  else
48    command -nargs=+ HiLink hi def link <args>
49  endif
50
51    " Comment
52    HiLink lComment         Comment
53
54    " PreProc (Include, PreCondit)
55    HiLink lInclude         Include
56
57    " Constant (String, Character, Number, Boolean, Float)
58    HiLink lString          String
59    HiLink lCharacter       Character
60
61    " Special (Tag, SpecialChar, SpecialComment, Debug)
62    HiLink lSpecial	    Special
63    HiLink lSpecialChar     SpecialChar
64
65    " Identifier (Function)
66    HiLink lFunction        Function
67
68    " Statement (Conditional, Repeat, Label, Operator, Keyword, Exception)
69    HiLink lStatement       Statement
70    HiLink lRepeat          Repeat
71    HiLink lConditional     Conditional
72
73    " Type (StorageClass, Structure, Typedef)
74    HiLink lType            Type
75    HiLink lStructure       Structure
76    HiLink lStorageClass    StorageClass
77
78    " Error
79    HiLink lSpecialError    Error
80    HiLink lCharError	    Error
81
82    " Todo
83    HiLink lTodo	    Todo
84
85    " Delimiter
86    HiLink lDelimiter	    Delimiter
87
88  delcommand HiLink
89endif
90
91
92let b:current_syntax = "limbo"
93