Skip to content
This repository was archived by the owner on Aug 31, 2023. It is now read-only.

Commit caffa65

Browse files
Improved function param flexibility.
1 parent e4eed07 commit caffa65

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

syntaxes/pine.tmLanguage.json

+13-12
Original file line numberDiff line numberDiff line change
@@ -131,24 +131,24 @@
131131
"match": "\\s*,\\s*"
132132
},
133133
"functionParam": {
134-
"name": "variable.parameter.pine",
135134
"patterns": [
136135
{
137-
"begin": "(?<=(?:\\(|,|^)\\s*)((?:(?:simple|series)\\s+)?((int|float|string|bool)|(array|label|line)))\\s+(\\w+)\\s*(=)\\s*",
136+
"name": "variable.parameter.pine",
137+
"begin": "(?<=(?:\\(|,|^)\\s*)(((?:(?:simple|series)\\s+)?((int|float|string|bool)|(array|label|line)))(?:\\s+))?(\\w+)\\s*(=)\\s*",
138138
"beginCaptures": {
139-
"1": {
139+
"2": {
140140
"name": "meta.type.annotation.pine"
141141
},
142-
"3": {
142+
"4": {
143143
"name": "support.type.primitive.pine"
144144
},
145-
"4": {
145+
"5": {
146146
"name": "support.type.builtin.pine"
147147
},
148-
"5": {
148+
"6": {
149149
"name": "meta.definition.variable.name.pine"
150150
},
151-
"6": {
151+
"7": {
152152
"name": "keyword.operator.assignment.pine"
153153
}
154154
},
@@ -166,18 +166,19 @@
166166
"end": "(?=\\s*(?:$|,|\\)))"
167167
},
168168
{
169-
"match": "(?<=(?:\\(|,|^)\\s*)((?:(?:simple|series)\\s+)?((int|float|string|bool)|(array|label|line)))\\s+(\\w+)(?=\\s*(?:$|,|\\)))",
169+
"name": "variable.parameter.pine",
170+
"match": "(?<=(?:\\(|,|^)\\s*)(((?:(?:simple|series)\\s+)?((int|float|string|bool)|(array|label|line)))(?:\\s+))?(\\w+)(?=\\s*(?:$|,|\\)))",
170171
"captures": {
171-
"1": {
172+
"2": {
172173
"name": "meta.type.annotation.pine"
173174
},
174-
"3": {
175+
"4": {
175176
"name": "support.type.primitive.pine"
176177
},
177-
"4": {
178+
"5": {
178179
"name": "support.type.builtin.pine"
179180
},
180-
"5": {
181+
"6": {
181182
"name": "meta.definition.variable.name.pine"
182183
}
183184
}

0 commit comments

Comments
 (0)