summaryrefslogtreecommitdiffstats
path: root/runtime/syntax/poefilter.vim
blob: 6561f7a7044e3a125ea1d507b4ad899d11edb3cc (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
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
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
" Vim syntax file
" Language:	PoE item filter
" Maintainer:	ObserverOfTime <chronobserver@disroot.org>
" Filenames:	*.filter
" Last Change:	2023 Feb 10

if exists('b:current_syntax')
    finish
endif

let s:cpo_save = &cpoptions
set cpoptions&vim

" Comment
syn keyword poefilterTodo TODO NOTE XXX contained
syn match poefilterCommentTag /\[[0-9A-Z\[\]]\+\]/ contained
syn match poefilterComment /#.*$/ contains=poefilterTodo,poefilterCommentTag,@Spell

" Blocks
syn keyword poefilterBlock Show Hide Minimal

" Conditions
syn keyword poefilterCondition
            \ AlternateQuality
            \ AnyEnchantment
            \ BlightedMap
            \ Corrupted
            \ ElderItem
            \ ElderMap
            \ FracturedItem
            \ Identified
            \ Mirrored
            \ Replica
            \ Scourged
            \ ShapedMap
            \ ShaperItem
            \ SynthesisedItem
            \ UberBlightedMap
            \ skipwhite nextgroup=poefilterBoolean
syn keyword poefilterCondition
            \ ArchnemesisMod
            \ BaseType
            \ Class
            \ EnchantmentPassiveNode
            \ HasEnchantment
            \ HasExplicitMod
            \ ItemLevel
            \ SocketGroup
            \ Sockets
            \ skipwhite nextgroup=poefilterOperator,poefilterString
syn keyword poefilterCondition
            \ AreaLevel
            \ BaseArmour
            \ BaseDefencePercentile
            \ BaseEnergyShield
            \ BaseEvasion
            \ BaseWard
            \ CorruptedMods
            \ DropLevel
            \ EnchantmentPassiveNum
            \ GemLevel
            \ HasEaterOfWorldsImplicit
            \ HasSearingExarchImplicit
            \ Height
            \ LinkedSockets
            \ MapTier
            \ Quality
            \ StackSize
            \ Width
            \ skipwhite nextgroup=poefilterOperator,poefilterNumber
syn keyword poefilterCondition
            \ GemQualityType
            \ skipwhite nextgroup=poefilterString,poefilterQuality
syn keyword poefilterCondition
            \ HasInfluence
            \ skipwhite nextgroup=poefilterString,poefilterInfluence
syn keyword poefilterCondition
            \ Rarity
            \ skipwhite nextgroup=poefilterString,poefilterRarity

" Actions
syn keyword poefilterAction
            \ PlayAlertSound
            \ PlayAlertSoundPositional
            \ skipwhite nextgroup=poefilterNumber,poefilterDisable
syn keyword poefilterAction
            \ CustomAlertSound
            \ CustomAlertSoundOptional
            \ skipwhite nextgroup=poefilterString
syn keyword poefilterAction
            \ DisableDropSound
            \ EnableDropSound
            \ DisableDropSoundIfAlertSound
            \ EnableDropSoundIfAlertSound
            \ skipwhite nextgroup=poefilterBoolean
syn keyword poefilterAction
            \ MinimapIcon
            \ SetBackgroundColor
            \ SetBorderColor
            \ SetFontSize
            \ SetTextColor
            \ skipwhite nextgroup=poefilterNumber
syn keyword poefilterAction
            \ PlayEffect
            \ skipwhite nextgroup=poefilterColour

" Operators
syn match poefilterOperator /!\|[<>=]=\?/ contained
            \ skipwhite nextgroup=poefilterString,poefilterNumber,
            \ poefilterQuality,poefilterRarity,poefilterInfluence

" Arguments
syn match poefilterString /[-a-zA-Z0-9:,']/ contained contains=@Spell
            \ skipwhite nextgroup=poefilterString,poefilterNumber,
            \ poefilterQuality,poefilterRarity,poefilterInfluence
syn region poefilterString matchgroup=poefilterQuote keepend
            \ start=/"/ end=/"/ concealends contained contains=@Spell
            \ skipwhite nextgroup=poefilterString,poefilterNumber,
            \ poefilterQuality,poefilterRarity,poefilterInfluence
syn match poefilterNumber /-1\|0\|[1-9][0-9]*/ contained
            \ skipwhite nextgroup=poefilterString,poefilterNumber,
            \ poefilterQuality,poefilterRarity,poefilterInfluence,poefilterColour
syn keyword poefilterBoolean True False contained

" Special arguments (conditions)
syn keyword poefilterQuality Superior Divergent Anomalous Phantasmal
            \ contained skipwhite nextgroup=poefilterString,poefilterQuality
syn keyword poefilterRarity Normal Magic Rare Unique
            \ contained skipwhite nextgroup=poefilterString,poefilterRarity
syn keyword poefilterInfluence Shaper Elder
            \ Crusader Hunter Redeemer Warlord None
            \ contained skipwhite nextgroup=poefilterString,poefilterInfluence

" Special arguments (actions)
syn keyword poefilterColour Red Green Blue Brown
            \ White Yellow Cyan Grey Orange Pink Purple
            \ contained skipwhite nextgroup=poefilterShape,poefilterTemp
syn keyword poefilterShape Circle Diamond Hecagon Square Star Triangle
            \ Cross Moon Raindrop Kite Pentagon UpsideDownHouse contained
syn keyword poefilterDisable None contained
syn keyword poefilterTemp Temp contained

" Colours

hi def link poefilterAction Statement
hi def link poefilterBlock Structure
hi def link poefilterBoolean Boolean
hi def link poefilterColour Special
hi def link poefilterComment Comment
hi def link poefilterCommentTag SpecialComment
hi def link poefilterCondition Conditional
hi def link poefilterDisable Constant
hi def link poefilterInfluence Special
hi def link poefilterNumber Number
hi def link poefilterOperator Operator
hi def link poefilterQuality Special
hi def link poefilterQuote Delimiter
hi def link poefilterRarity Special
hi def link poefilterShape Special
hi def link poefilterString String
hi def link poefilterTemp StorageClass
hi def link poefilterTodo Todo

let b:current_syntax = 'poefilter'

let &cpoptions = s:cpo_save
unlet s:cpo_save