-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloc.vim
133 lines (105 loc) · 4.59 KB
/
loc.vim
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
" Vim syntax file
" Language: morloc
" Maintainer: Zebulun Arendsee
" -----------------------------------------------------------------------------
" =============================================================================
" P R E A M B L E
" -----------------------------------------------------------------------------
if exists("b:current_syntax")
finish
endif
let b:current_syntax = "loc"
" =============================================================================
" K E Y W O R D S
" -----------------------------------------------------------------------------
syn keyword reserved where
syn keyword reserved module
syn keyword reserved from
syn keyword reserved as
syn keyword reserved source
syn keyword reserved export
syn keyword reserved True
syn keyword reserved False
" -----------------------------------------------------------------------------
hi def link reserved Keyword
" =============================================================================
" P R I M A T I V E S
" -----------------------------------------------------------------------------
syn region s_string start=/"/ end=/"/
syn region s_execute start=/`/ end=/`/
syn region s_execute start=/\[[a-zA-Z0-9]*|/ end=/|\]/
syn match s_num '\([a-zA-Z_]\)\@<!\<[0-9]\+\>\([a-zA-Z_]\)\@!'
syn match s_dbl '\([a-zA-Z_]\)\@<!\<[0-9]\+\.[0-9]\+\>\([a-zA-Z_]\)\@!'
" syn match s_num '\v(\h)@<!-?(\d*\.\d+|\d+)(\h)\@!'
" ------- -------
" negative look behind negative look ahead
" -----------------------------------------------------------------------------
hi def link s_num Number
hi def link s_dbl Number
hi def link s_string String
hi def link s_execute String
" =============================================================================
" O P E R A T O R S
" -----------------------------------------------------------------------------
syn match operator /=/
syn match operator /::/
syn match operator /:/
syn match operator /,/
syn match operator /(/
syn match operator /)/
syn match operator /\[/
syn match operator /\]/
syn match operator /{/
syn match operator /}/
syn match operator /->/
syn match operator /=>/
" operators allowed in constraints
syn match operator />/
syn match operator /</
syn match operator />=/
syn match operator /<=/
syn match operator /+/
syn match operator /-/
syn match operator /\//
syn match operator /\/\// " integer division
syn match operator /%/ " modulus
syn match operator /^/ " exponentiation
syn match operator /;/
syn match operator /@/
" -----------------------------------------------------------------------------
hi def link operator Operator
" =============================================================================
" M I S C E L L A N I A
" -----------------------------------------------------------------------------
syn match s_varlabel '\w\+:'
syn match s_varlabel '<\w\+>'
" -----------------------------------------------------------------------------
hi def link s_varlabel Special
" =============================================================================
" C O M M E N T S
" -----------------------------------------------------------------------------
" define todo highlighting
syn match s_todo /\(TODO\|NOTE\|FIXME\):/ contained
syn keyword s_todo XXX contained
syn match s_tag /\(Author\|Email\|Github\|Bugs\|Website\|Maintainer\|Description\):/ contained
" define comments
" syn match comment '\/\/.*$' contains=tag
" syn region comment start='\/\*' end='\*\/' contains=tag
syn match s_comment '--.*' contains=s_todo,s_tag
syn region s_comment start="{-" end="-}" contains=s_todo,s_tag
" =============================================================================
" E R R O R S
" -----------------------------------------------------------------------------
syn match s_error '^#'
syn match reserved '\<table\>'
syn match reserved '\<import\>'
syn match reserved '\<type\>'
syn match reserved '\<instance\>'
syn match reserved '\<class\>'
syn match reserved '\<object\>'
syn match reserved '\<record\>'
" -----------------------------------------------------------------------------
hi def link s_comment Comment
hi def link s_todo Todo
hi def link s_tag SpecialComment
hi def link s_error Error