1
1
{
2
- "$schema" : " https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json" ,
3
- "name" : " Pine Script" ,
4
- "patterns" : [
2
+ "$schema" : " https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json" ,
3
+ "name" : " Pine Script" ,
4
+ "patterns" : [
5
5
{
6
6
"match" : " //.*" ,
7
7
"name" : " comment.pine"
8
8
},
9
9
{
10
- "include" : " #constants"
11
- },
10
+ "include" : " #constants"
11
+ },
12
12
{
13
- "include" : " #functions"
14
- },
13
+ "include" : " #functions"
14
+ },
15
15
{
16
- "include" : " #operators"
17
- },
16
+ "include" : " #operators"
17
+ },
18
18
{
19
- "include" : " #keywords"
20
- },
21
- {
22
- "include" : " #strings"
23
- }
24
- ],
25
- "repository" : {
19
+ "include" : " #keywords"
20
+ },
21
+ {
22
+ "include" : " #strings"
23
+ }
24
+ ],
25
+ "repository" : {
26
26
"strings" : {
27
27
"patterns" : [
28
28
{
38
38
"name" : " punctuation.definition.string.end.pine"
39
39
}
40
40
},
41
- "name" : " string.quoted.double.pine" ,
41
+ "name" : " string.quoted.double.pine" ,
42
42
"patterns" : [
43
43
{
44
44
"match" : " \\\\ ." ,
50
50
"begin" : " '" ,
51
51
"beginCaptures" : {
52
52
"1" : {
53
- "name" : " punctuation.definition.string.begin.pine"
53
+ "name" : " punctuation.definition.string.begin.pine"
54
54
}
55
55
},
56
56
"end" : " '" ,
59
59
"name" : " punctuation.definition.string.end.pine"
60
60
}
61
61
},
62
- "name" : " string.quoted.double.pine" ,
62
+ "name" : " string.quoted.double.pine" ,
63
63
"patterns" : [
64
64
{
65
65
"match" : " \\\\ ." ,
74
74
{
75
75
"match" : " \\ b(abs|acos|alertcondition|alma|asin|atan|atr|avg|bar(color|since)|bb|bbw|bgcolor|bool|cci|ceil|change|cmo|cog|color|color\\ .new|correlation|cos|cross|crossover|crossunder|cum|dayofmonth|dayofweek|dev|dmi|ema|exp|falling|fill|financial|fixnan|float|floor|heikinashi|highest|highestbars|hline|hma|hour|iff|input|int|kagi|kc|kcw|label|line|linebreak|linreg|log|log10|lowest|lowestbars|macd|max|max_bars_back|mfi|min|minute|mom|month|na|nz|offset|percentile_linear_interpolation|percentile_nearest_rank|pivothigh|pivotlow|plot|plotarrow|plotbar|plotcandle|plotchar|plotshape|pointfigure|pow|quandl|renko|rising|rma|roc|round|rsi|sar|second|security|sign|sin|sma|sqrt|stdev|stoch|str\\ .replace_all|strategy|string|study|sum|supertrend|swma|tan|tickerid|time|timestamp|tostring|tr|tsi|valuewhen|variance|vwma|weekofyear|wma|wpr|year)(?=\\ ()" ,
76
76
"captures" : {
77
- "1" : {
78
- "name" : " support.function.pine"
79
- }
80
- }
77
+ "1" : {
78
+ "name" : " support.function.pine"
79
+ }
80
+ }
81
81
},
82
82
{
83
83
"match" : " \\ barray\\ .(avg|clear|concat|copy|covariance|fill|get|includes|indexof|insert|lastindexof|max|median|min|mode|new_bool|new_color|new_float|new_int|pop|push|remove|reverse|set|shift|size|slice|sort|standardize|stdev|sum|unshift|variance)(?=\\ ()" ,
84
84
"captures" : {
85
- "1" : {
86
- "name" : " support.function.pine"
87
- }
88
- }
85
+ "1" : {
86
+ "name" : " support.function.pine"
87
+ }
88
+ }
89
89
},
90
90
{
91
91
"match" : " \\ blabel\\ .(delete|get_text|get_x|get_y|new|set_color|set_size|set_text|set_textalign|set_textcolor|set_tooltip|set_x|set_xloc|set_xy|set_y|set_yloc)(?=\\ ()" ,
92
92
"captures" : {
93
- "1" : {
94
- "name" : " support.function.pine"
95
- }
96
- }
93
+ "1" : {
94
+ "name" : " support.function.pine"
95
+ }
96
+ }
97
97
},
98
98
{
99
99
"match" : " \\ bline\\ .(delete|get_price|get_x1|get_x2|get_y1|get_y2|new|set_color|set_extend|set_style|set_width|set_x1|set_x2|set_xloc|set_xy1|set_xy2|set_y1|set_y2)(?=\\ ()" ,
100
100
"captures" : {
101
- "1" : {
102
- "name" : " support.function.pine"
103
- }
104
- }
101
+ "1" : {
102
+ "name" : " support.function.pine"
103
+ }
104
+ }
105
105
},
106
106
{
107
107
"match" : " \\ bstrategy\\ .(cancel|cancel_all|close|close_all|entry|exit|order)(?=\\ ()" ,
108
108
"captures" : {
109
- "1" : {
110
- "name" : " support.function.pine"
111
- }
112
- }
109
+ "1" : {
110
+ "name" : " support.function.pine"
111
+ }
112
+ }
113
113
},
114
114
{
115
115
"match" : " \\ bstrategy\\ .risk\\ .(allow_entry_in|max_cons_loss_days|max_drawdown|max_intraday_filled_orders|max_intraday_loss|max_position_size)(?=\\ ()" ,
116
116
"captures" : {
117
- "1" : {
118
- "name" : " support.function.pine"
119
- }
120
- }
117
+ "1" : {
118
+ "name" : " support.function.pine"
119
+ }
120
+ }
121
121
},
122
122
{
123
123
"match" : " [a-zA-Z_][a-zA-Z0-9_]*\\ s*(?=\\ =)" ,
126
126
{
127
127
"match" : " ([a-zA-Z_][a-zA-Z0-9_]*)\\ (.*\\ )\\ s(=>)\\ s" ,
128
128
"captures" : {
129
- "1" : {
130
- "name" : " support.function.pine"
131
- },
132
- "2" : {
133
- "name" : " keyword.operator.assignment.pine"
134
- }
135
- }
129
+ "1" : {
130
+ "name" : " support.function.pine"
131
+ },
132
+ "2" : {
133
+ "name" : " keyword.operator.assignment.pine"
134
+ }
135
+ }
136
136
}
137
137
]
138
138
},
139
139
"constants" : {
140
- "patterns" :[
140
+ "patterns" : [
141
141
{
142
142
"match" : " \\ b(true|false)\\ b" ,
143
143
"name" : " constant.language.pine"
301
301
]
302
302
},
303
303
"keywords" : {
304
- "patterns" : [{
305
- "name" : " keyword.control.pine" ,
306
- "match" : " \\ b(if|else|while|for|return)\\ b"
307
- }]
308
- }
309
- },
310
- "scopeName" : " source.pine"
304
+ "patterns" : [
305
+ {
306
+ "name" : " keyword.control.pine" ,
307
+ "match" : " \\ b(if|else|while|for|return)\\ b"
308
+ }
309
+ ]
310
+ }
311
+ },
312
+ "scopeName" : " source.pine"
311
313
}
0 commit comments