summarylogtreecommitdiffstats
path: root/syntax.vim
blob: 4c4a5cdd5b1556485c8e4881f9efa61e2eb10e39 (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
if exists("b:current_syntax")
    finish
endif

syntax keyword pseucoKW if else elseif
syntax keyword pseucoKW for while return do continue break default select mutex
syntax keyword pseucoKW waitForCondition signal signalAll condition with
syntax keyword pseucoBool true false
syntax keyword pseucoFunctions println join start unlock
" never swap the following two lines
syntax match pseucoFunctions "\Vlock"
syntax match pseucoTypes "\Vlock "

syntax match pseucoTypes "\V\(int\|bool\|string\)chan\d\*"
syntax keyword pseucoTypes int void bool agent
syntax keyword pseucoTypes struct monitor


syntax match pseucoOperator "\v\+\+"
syntax match pseucoOperator "\v\-\-"
syntax match pseucoOperator "\v\+\="
syntax match pseucoOperator "\v\-\="
syntax match pseucoOperator "\v\*\="
syntax match pseucoOperator "\v\/\="

syntax match pseucoOperator "\v\!"
syntax match pseucoOperator "\v\|\|"
syntax match pseucoOperator "\v\&\&"
syntax match pseucoOperator "\v\%"

syntax match pseucoOperator "\v\<\?"
syntax match pseucoOperator "\v\<\!"


syntax match pseucoNumber "\v<\d+>"

syntax region pseucoString start=/"/ skip=/\\"/ end=/"/ oneline

highlight default link pseucoString String

syntax match pseucoOperator "\v\+"
syntax match pseucoOperator "\v\-"
syntax match pseucoOperator "\v\*"
syntax match pseucoOperator "\v\/"
syntax match pseucoOperator "\v\?"
syntax match pseucoOperator "\v\:"

syntax keyword mainAgent mainAgent

syntax match pseucoComment "\v *\/\/.*$"


highlight default link pseucoComment Comment
highlight default link pseucoNumber Number
highlight default link pseucoOperator Operator
highlight default link pseucoBool Boolean

highlight default link pseucoKW Keyword
highlight default link mainAgent Include
highlight default link pseucoTypes Type

highlight default link pseucoFunctions Function

let b:current_syntax = "pseuco"