@@ -197,7 +197,7 @@ repository:
197197 patterns :
198198 # e.g. function play(arg1, arg2) { }
199199 - name : meta.function.js
200- begin : \b(function\* ?)(?:\s+ ([a-zA-Z_$][_$\w]*))?\s*
200+ begin : \b(function\s*\* ?)(?:\s* ([a-zA-Z_$][_$\w]*))?\s*
201201 beginCaptures :
202202 ' 1 ' : {name: storage.type.function.js}
203203 ' 2 ' : {name: entity.name.function.js}
@@ -207,7 +207,7 @@ repository:
207207
208208 # e.g. Sound.prototype.play = function(arg1, arg2) { }
209209 - name : meta.prototype.function.js
210- begin : ([_$a-zA-Z][_$\w]*)\.(prototype)\.([_$a-zA-Z][_$\w]*)\s*=\s*(function\*?)\s*
210+ begin : ([_$a-zA-Z][_$\w]*)\.(prototype)\.([_$a-zA-Z][_$\w]*)\s*=\s*(function\s*\ *?)\s*
211211 beginCaptures :
212212 ' 1 ' : {name: entity.name.class.js}
213213 ' 2 ' : {name: support.constant.js}
@@ -226,12 +226,12 @@ repository:
226226 ([_$a-zA-Z][_$\w]*)?
227227 \.([_$a-zA-Z][_$\w]*)\s*
228228 =\s*
229- (function\*?)\s*
229+ (function\s*\ *?)\s*
230230 )
231231 end : (?<=\))
232232 patterns :
233233 - include : ' #literal-language-variable'
234- - begin : \b(function\* ?)(?:\s+ ([a-zA-Z_$][_$\w]*))?\s*
234+ - begin : \b(function\s*\* ?)(?:\s* ([a-zA-Z_$][_$\w]*))?\s*
235235 beginCaptures :
236236 ' 1 ' : {name: storage.type.function.js}
237237 ' 2 ' : {name: entity.name.function.js}
@@ -241,7 +241,7 @@ repository:
241241
242242 # e.g. play: function(arg1, arg2) { }
243243 - name : meta.function.json.js
244- begin : \b([_$a-zA-Z][_$\w]*)\s*(:)\s*\b(function\*?)\s*
244+ begin : \b([_$a-zA-Z][_$\w]*)\s*(:)\s*\b(function\s*\ *?)\s*
245245 beginCaptures :
246246 ' 1 ' : {name: entity.name.function.js}
247247 ' 2 ' : {name: punctuation.separator.key-value.js}
@@ -259,7 +259,7 @@ repository:
259259 ((")(.*?)(?<!\\)("))
260260 )\s*
261261 (:)\s*
262- \b(function\*?)\s*
262+ \b(function\s*\ *?)\s*
263263 beginCaptures :
264264 ' 1 ' : {name: string.quoted.single.js}
265265 ' 2 ' : {name: punctuation.definition.string.begin.js}
0 commit comments