@@ -13,27 +13,53 @@ contexts:
13
13
- match : //.*
14
14
scope : comment.pine
15
15
16
- # constants
16
+ # constant:
17
+ - match : \b(bool|true|false)\b
18
+ scope : constant.language.pine
19
+
20
+ - match : \b(timenow|year|month|weekofyear|dayofmonth|hour|minute|second|interval|isdaily|isdwm|isintraday|ismonthly|isweekly)\b
21
+ scope : constant.language.pine
22
+
23
+ - match : \b(time)\_(close|tradingday)\b
24
+ scope : constant.language.pine
17
25
18
- - match : \b(true|false )\b
26
+ - match : \b(timeframe)\.(isdaily|isdwm|isintraday|isminutes|ismonthly|isseconds|isweekly|multiplier|period )\b
19
27
scope : constant.language.pine
20
28
21
- - match : \b(bool|float|integer|string )\b
29
+ - match : \b(open|high|low|close|hl2|hlc3|hlcc4|volume|na|period|tickerid|source|symbol )\b
22
30
scope : constant.language.pine
23
31
24
- - match : \b(time|timenow|year|month|weekofyear|dayofmonth|dayofweek|hour|minute|second|interval|isdaily|isdwm|isintraday|ismonthly|isweekly )\b
32
+ - match : \b(xloc.bar)\.(index|time )\b
25
33
scope : constant.language.pine
26
34
27
- - match : \b(open|high|low|close|volume|na|period|tikerid|source|symbol )\b
35
+ - match : \b(yloc)\.(abovebar|belowbar|price )\b
28
36
scope : constant.language.pine
29
37
30
38
- match : \b(accdist|area|areabr|hl(2|c3)|ohlc4)\b
31
39
scope : constant.language.pine
32
40
33
- - match : \badjustment\.(dividends|none|splits)\b
41
+ - match : \b(table.all)\b
42
+ scope : constant.language.pine
43
+
44
+ - match : \b(text)\.(align|wrap)\_(bottom|center|left|right|top|auto|none)\b
45
+ scope : constant.language.pine
46
+
47
+ - match : \b(ta)\.(accdist|iii|nvi|obv|pvi|pvt|tr|vwap|wad|wvad)\b
48
+ scope : constant.language.pine
49
+
50
+ - match : \b(adjustment)\.(dividends|none|splits)\b
51
+ scope : constant.language.pine
52
+
53
+ - match : \b(splits)\.(denominator|numerator)\b
54
+ scope : constant.language.pine
55
+
56
+ - match : \b(position)\.(bottom|middle|top)\_(center|left|right)\b
34
57
scope : constant.language.pine
35
58
36
- - match : \b(monday|tuesday|wednesday|thursday|friday|saturday|sunday|dayofweek)\b
59
+ - match : \b(alert)\.(freq_all|freq_once_per_bar|freq_once_per_bar_close)\b
60
+ scope : constant.language.pine
61
+
62
+ - match : \b(dayofweek|dayofweek.(monday|tuesday|wednesday|thursday|friday|saturday|sunday))\b
37
63
scope : constant.language.pine
38
64
39
65
- match : \b(line|stepline|histogram|cross[^\(]|area|columns|circles)\b
@@ -42,37 +68,90 @@ contexts:
42
68
- match : \b(solid|dotted|dashed)\b
43
69
scope : constant.language.pine
44
70
45
- - match : \b(session|session.(extended|regular))\b
71
+ - match : \b(bar_index)\b
72
+ scope : constant.language.pine
73
+
74
+ - match : \b(session|session.(extended|regular|ismarket|ispostmarket|ispremarket))\b
75
+ scope : constant.language.pine
76
+
77
+ - match : \b(scale).(left|none|right)\b
78
+ scope : constant.language.pine
79
+
80
+ - match : \b(barmerge)\.(gaps_(off|on)|lookahead_(off|on))\b
81
+ scope : constant.language.pine
82
+
83
+ - match : \b(barstate)\.is(confirmed|first|history|last|new|realtime|islastconfirmedhistory)\b
84
+ scope : constant.language.pine
85
+
86
+ - match : \b(box)\.(all)\b
87
+ scope : constant.language.pine
88
+
89
+ - match : \b(currency)\.(AUD|CAD|CHF|EUR|GBP|HKD|JPY|NOK|NONE|NZD|RUB|SEK|SGD|TRY|USD|ZAR)\b
46
90
scope : constant.language.pine
47
91
48
- - match : \bscale.(left |none|right )\b
92
+ - match : \b(display)\.(all |none)\b
49
93
scope : constant.language.pine
50
94
51
- - match : \bbarmerge \.(gaps_(off|on)|lookahead_(off|on) )\b
95
+ - match : \b(label) \.(all )\b
52
96
scope : constant.language.pine
53
97
54
- - match : \bbarstate\.is(confirmed|first|history|last|new|realtime )\b
98
+ - match : \b(math)\.(e|phi|pi|rphi )\b
55
99
scope : constant.language.pine
56
100
57
- - match : \bcurrency\.(AUD|CAD|CHF|EUR|GBP|HKD|JPY|NOK|NONE|NZD|RUB|SEK|SGD|TRY|USD|ZAR )\b
101
+ - match : \b(label.style)\_(arrowdown|arrowup|circle|cross|diamond|flag|label_center|label_down|label_left|label_lower_left|label_lower_right|label_upper_left|label_upper_right|none|square|triangledown|triangleup|xcross )\b
58
102
scope : constant.language.pine
59
103
60
- - match : \blocation\.(abovebar|belowbar|top|bottom|absolute)\b
104
+ - match : \b(last_bar)\.(index|time)\b
105
+ scope : constant.language.pine
106
+
107
+ - match : \b(earnings)\.(actual|estimate|standardized)\b
108
+ scope : constant.language.pine
109
+
110
+ - match : \b(extend)\.(both|left|none|right)\b
111
+
112
+ - match : \b(location)\.(abovebar|belowbar|top|bottom|absolute)\b
113
+ scope : constant.language.pine
114
+
115
+ - match : \b(line.all)\b
116
+ scope : constant.language.pine
117
+
118
+ - match : \b(linefill.all)\b
119
+ scope : constant.language.pine
120
+
121
+ - match : \b(line.style)\_(arrow_both|arrow_left|arrow_right|dashed|dotted|solid)\b
122
+ scope : constant.language.pine
123
+
124
+ - match : \b(hline.style)\_(dashed|dotted|solid)\b
125
+ scope : constant.language.pine
126
+
127
+ - match : \b(format)\.(inherit|mintick|percent|price|volume)\b
61
128
scope : constant.language.pine
62
129
63
130
- match : \bshape\.(x(cross)?|(triangle|arrow|label)(up|down)|flag|circle|square|diamond)\b
64
131
scope : constant.language.pine
65
132
133
+ - match : \bshape\.(arrowdown|arrowup|circle|cross|diamond|flag|labeldown|labelup|square|triangledown|triangleup)\b
134
+ scope : constant.language.pine
135
+
66
136
- match : \bsize\.(auto|huge|large|normal|small|tiny)\b
67
137
scope : constant.language.pine
68
138
69
- - match : \bstrategy\.(cash|closedtrades|commission\.(cash_per_contract|cash_per_order|percent)|direction\.(all|long|short)|equity|eventrades|fixed|grossloss|grossprofit|initial_capital|long|losstrades|max_contracts_held_all|max_contracts_held_long|max_contracts_held_short|max_drawdown|netprofit|oca\.(cancel|none|reduce)|openprofit|opentrades|percent_of_equity|position_avg_price|position_entry_name|position_size|short|wintrades)\b
139
+ - match : \b(plot.style)\_(area|areabr|circles|columns|cross|histogram|line|linebr|stepline|stepline_diamond)\b
140
+ scope : constant.language.pine
141
+
142
+ - match : \bstrategy\.(cash|closedtrades|commission\.(cash_per_contract|cash_per_order|percent)|direction\.(all|long|short)|equity|eventrades|fixed|grossloss|grossprofit|initial_capital|long|losstrades|max_contracts_held_all|max_contracts_held_long|max_contracts_held_short|max_drawdown|netprofit|oca\.(cancel|none|reduce)|openprofit|opentrades|percent_of_equity|position_avg_price|position_entry_name|position_size|short|wintrades)(account_currency)\b
143
+ scope : constant.language.pine
144
+
145
+ - match : \bsyminfo\.(basecurrency|currency|description|mintick|pointvalue|prefix|root|session|ticker|tickerid|timezone|type)\b
70
146
scope : constant.language.pine
71
147
72
- - match : \bsyminfo \.(mintick|pointvalue|prefix|root|session|timezone )\b
148
+ - match : \b(color) \.(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow )\b
73
149
scope : constant.language.pine
74
150
75
- - match : \b(aqua|black|silver|gray|white|maroon|red|purple|fuchsia|green|lime|olive|yellow|navy|blue|teal|orange)\b
151
+ - match : \b(dividends)\.(gross|net)\b
152
+ scope : constant.language.pine
153
+
154
+ - match : \b(order)\.(ascending|descending)\b
76
155
scope : constant.language.pine
77
156
78
157
- match : ' #[a-fA-F0-9]{6}'
@@ -81,25 +160,43 @@ contexts:
81
160
- match : ' \b([0-9]+)\b'
82
161
scope : constant.numeric.pine
83
162
84
- # strings
163
+ - match : \b(int)\b
164
+ scope : constant.numeric.integer.pine
165
+
166
+ - match : \b(float)\b
167
+ scope : constant.numeric.float.pine
85
168
169
+ # var
170
+ - match : \b(var|varip)\b
171
+ scope : variable.other.pine
172
+
173
+ # strings
86
174
- match : ' '' '
87
175
push : single-quoted-string
88
176
- match : ' "'
89
177
push : double-quoted-string
178
+ - match : \b(string)\b
179
+ scope : string.pine
90
180
91
181
# operators
92
182
93
- - match : (\-|\+|\*|/|% )
183
+ - match : (\-|\+|\*|\/|\%|\*=|\+=|\-=|\/= )
94
184
scope : keyword.operator.arithmetic.pine
95
- - match : (==|!=|<=|> =|<|>|\:=)
185
+ - match : (==|!=|<=|=>|> =|<|>|\:=|% =)
96
186
scope : keyword.operator.comparison.pine
97
187
- match : (\?|\:)
98
188
scope : keyword.operator.ternary.pine
99
189
- match : \b(and|or|not)\b
100
190
scope : keyword.operator.logical.pine
101
191
- match : " ="
102
192
scope : keyword.operator.assignment.pine
193
+
194
+ # control
195
+ - match : \b(//@version=5|export|import|series|simple|switch|)\b
196
+ scope : keyword.control.import.pine
197
+
198
+ - match : (|if|else|for|for...in|while)
199
+ scope : keyword.control.conditional.pine
103
200
104
201
# functions
105
202
@@ -110,7 +207,7 @@ contexts:
110
207
- match : ' {{identifier_regex}}\s*(?=:?\=)'
111
208
scope : variable.parameter.pine
112
209
113
- - match : ('({{identifier_regex}})\(.*\)\s(=>)\s'|if|else )
210
+ - match : ('({{identifier_regex}})\(.*\)\s(=>)\s')
114
211
captures :
115
212
1 : entity.name.function
116
213
2 : keyword.operator.assignment.pine
0 commit comments