summaryrefslogtreecommitdiff
path: root/support/vim/syntax/stage.vim
blob: 13d86b46434c4a3bb39af2f64b6d19c487d35b9b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
" Vim syntax file
" Language:	Stage
" Maintainer:	Mike Buland :)
" Last Change:	2012 Dec 30

" For version 5.x: Clear all syntax items
" For version 6.x: Quit when a syntax file was already loaded
if version < 600
  syntax clear
elseif exists("b:current_syntax")
  finish
endif

" Keywords
syn keyword Conditional if then else
syn keyword Loop        for each do in while
syn keyword Logic       not and or
syn keyword Statement   setup enter
syn keyword Todo        TODO FIXME XXX
syn keyword Type        function command situation game global player
syn keyword Constant    null true false
syn keyword Builtins    display goto exists delete exit return random integer float string debugString keys join

syn cluster CommentGroup contains=Todo

syn match Special display contained "\\\(x\x\+\|\o\{1,3}\|.\|$\)"
syn match Special display contained "\\\(u\x\{4}\|U\x\{8}\)"

" TODO: do we want to end at end of line too?
syn region singleString start=+'+ skip=+\\\\\|\\'+ end=+'+ contains=Special
syn region doubleString start=+"+ skip=+\\\\\|\\"+ end=+"+ contains=Special
syn region tripSingleString start=+'''+ end=+'''+ contains=Special
syn region tripDoubleString start=+"""+ end=+"""+ contains=Special
syn region sitName start=+<<+ end=+>>+ contains=Special

syn case ignore
syn match Numbers display transparent "\<\d\|\.\d" contains=Number,Float,OctalError,Octal
syn match Number display contained "\d\+\(u\=l\{0,2}\|ll\=u\)\>"
" Hex
syn match Number display contained "0x\x\+\(u\=l\{0,2}\|ll\=u\)\>"
syn match Octal display contained "0\o\+\(u\=l\{0,2}\|ll\=u\)\>" contains=cOctalZero
syn match OctalZero display contained "\<0"
syn match Float display contained "\d\+f"
syn match Float display contained "\d\+\.\d*\(e[-+]\=\d\+\)\=[fl]\="
syn match Float display contained "\.\d\+\(e[-+]\=\d\+\)\=[fl]\=\>"
syn match Float display contained "\d\+e[-+]\=\d\+[fl]\=\>"
" Flag bad digits in octal
syn match OctalError display contained "0\o*[89]\d*"
syn case match


syn region cppComment start="#" skip="\\$" end="$" contains=@CommentGroup keepend
syn region cComment start="/\*" end="\*/" contains=@CommentGroup fold
syn region cppComment start="//" skip="\\$" end="$" contains=@CommentGroup keepend


syntax region Block start="{" end="}" transparent fold

hi def link OctalError Error
hi def link cComment   Comment
hi def link cppComment Comment
hi def link tripSingleString String
hi def link tripDoubleString String
hi def link singleString String
hi def link doubleString String
hi def link sitName String
hi def link cmdEx String
hi def link Constructor Operator
hi def link Logic Statement
hi def link Loop Conditional
hi def link Builtins Function
hi def link TargetProcess Type