on master help sign in
Update F# syntax
c96927bBjörn
assets/syntaxes/FSharp+1−1

Submodule changed.

assets/syntaxes/FSharp.sublime-syntax+559−121
@@ -9,63 +9,230 @@ file_extensions:
9scope: source.fsharp
9scope: source.fsharp
10contexts:
10contexts:
11 main:
11 main:
12+ - include: compiler_directives
12 - include: comments
13 - include: comments
13 - include: constants
14 - include: constants
14− - include: structure
15− - include: attributes
16 - include: strings
15 - include: strings
16+ - include: chars
17+ - include: double_tick
17 - include: definition
18 - include: definition
18− - include: method_calls
19+ - include: abstract_definition
20+ - include: attributes
19 - include: modules
21 - include: modules
20 - include: anonymous_functions
22 - include: anonymous_functions
23+ - include: du_declaration
24+ - include: record_declaration
25+ - include: records
26+ - include: strp_inlined
21 - include: keywords
27 - include: keywords
28+ - include: cexprs
29+ - include: text
30+ abstract_definition:
31+ - match: '\b(abstract)\s+(member)?(\s+\[\<.*\>\])?\s*([_[:alpha:]0-9,\._`\s]+)(:)'
32+ captures:
33+ 1: keyword.fsharp
34+ 2: keyword.fsharp
35+ 3: support.function.attribute.fsharp
36+ 5: keyword.fsharp
37+ push:
38+ - meta_scope: abstract.definition.fsharp
39+ - match: \s*(with)\b|=|$
40+ captures:
41+ 1: keyword.fsharp
42+ pop: true
43+ - include: comments
44+ - include: common_declaration
45+ - match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([[:alpha:]0-9''`^._ ]+)){0,1}'
46+ captures:
47+ 1: keyword.symbol.fsharp
48+ 2: variable.parameter.fsharp
49+ 3: keyword.symbol.fsharp
50+ 4: entity.name.type.fsharp
51+ - match: '(?!with|get|set\b)\b([\w0-9''`^._]+)'
52+ captures:
53+ 1: entity.name.type.fsharp
54+ - include: keywords
22 anonymous_functions:
55 anonymous_functions:
23 - match: \b(fun)\b
56 - match: \b(fun)\b
24 captures:
57 captures:
25− 1: keyword.other.function-definition.fsharp
58+ 1: keyword.fsharp
26 push:
59 push:
27− - meta_scope: meta.function.anonymous
60+ - meta_scope: function.anonymous
28 - match: (->)
61 - match: (->)
29 captures:
62 captures:
30− 1: keyword.other.fsharp
63+ 1: keyword.fsharp
31 pop: true
64 pop: true
65+ - include: comments
66+ - match: (\()
67+ captures:
68+ 1: keyword.symbol.fsharp
69+ push:
70+ - match: \s*(?=(->))
71+ captures:
72+ 1: keyword.symbol.fsharp
73+ pop: true
74+ - include: member_declaration
32 - include: variables
75 - include: variables
33 attributes:
76 attributes:
34 - match: '\[\<'
77 - match: '\[\<'
35 push:
78 push:
36 - meta_scope: support.function.attribute.fsharp
79 - meta_scope: support.function.attribute.fsharp
37− - match: '\>\]'
80+ - match: '\>\]|\]'
38 pop: true
81 pop: true
39 - include: main
82 - include: main
40− characters:
83+ cexprs:
41− - match: (')
84+ - match: '\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)\s*\{'
85+ scope: cexpr.fsharp
42 captures:
86 captures:
43− 1: punctuation.definition.string.begin.fsharp
87+ 0: keyword.fsharp
44− push:
88+ chars:
89+ - match: ('\\?.')
90+ scope: char.fsharp
91+ captures:
45− - meta_scope: string.quoted.single.fsharp
92+ 1: string.quoted.single.fsharp
46− - match: (')
47− captures:
48− 1: punctuation.definition.string.end.fsharp
49− pop: true
50− - match: '\\$[ \t]*'
51− scope: punctuation.separator.string.ignore-eol.fsharp
52− - match: '\\([\\""ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})'
53− scope: constant.character.string.escape.fsharp
54− - match: '\\(?![\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).'
55− scope: invalid.illeagal.character.string.fsharp
56 comments:
93 comments:
57− - match: \(\*\*?(\*)\)
94+ - match: (\(\*(?!\)))
58− scope: comment.block.fsharp
59 captures:
95 captures:
60− 1: comment.block.empty.fsharp
96+ 1: comment.block.fsharp
61− - match: '\(\*[^\)]'
62 push:
97 push:
63 - meta_scope: comment.block.fsharp
98 - meta_scope: comment.block.fsharp
64− - match: \*\)
99+ - match: (\*\))
100+ captures:
101+ 1: comment.block.fsharp
65 pop: true
102 pop: true
66− - include: comments
67 - match: //.*$
103 - match: //.*$
68 scope: comment.line.double-slash.fsharp
104 scope: comment.line.double-slash.fsharp
105+ common_binding_definition:
106+ - include: comments
107+ - include: attributes
108+ - match: (:)\s*(\()\s*(static member|member)
109+ captures:
110+ 1: keyword.symbol.fsharp
111+ 2: keyword.symbol.fsharp
112+ 3: keyword.fsharp
113+ push:
114+ - match: (\))\s*((?=,)|(?=\=))
115+ captures:
116+ 1: keyword.symbol.fsharp
117+ pop: true
118+ - match: '(\^[[:alpha:]0-9''._]+)'
119+ captures:
120+ 1: entity.name.type.fsharp
121+ - include: variables
122+ - include: keywords
123+ - match: (:)\s*(\()
124+ captures:
125+ 1: keyword.symbol.fsharp
126+ 2: keyword.symbol.fsharp
127+ push:
128+ - match: '(\)\s*(([?[:alpha:]0-9''`^._ ]*)))'
129+ captures:
130+ 1: keyword.symbol.fsharp
131+ 2: entity.name.type.fsharp
132+ pop: true
133+ - include: tuple_signature
134+ - match: '(:)\s*(\^[[:alpha:]0-9''._]+)\s*(when)'
135+ captures:
136+ 1: keyword.symbol.fsharp
137+ 2: entity.name.type.fsharp
138+ 3: keyword.fsharp
139+ push:
140+ - match: (?=:)
141+ captures:
142+ 1: keyword.symbol.fsharp
143+ pop: true
144+ - match: \b(and|when|or)\b
145+ scope: keyword.fsharp
146+ - match: "([[:alpha:]0-9'^._]+)"
147+ comment: Because we first capture the keywords, we can capture what looks like a word and assume it's an entity definition
148+ captures:
149+ 1: entity.name.type.fsharp
150+ - match: (\(|\))
151+ scope: keyword.symbol.fsharp
152+ - match: '(:)\s*([?[:alpha:]0-9''`^._ ]+)'
153+ captures:
154+ 1: keyword.symbol.fsharp
155+ 2: entity.name.type.fsharp
156+ - match: '(->)\s*(\()?\s*([?[:alpha:]0-9''`^._ ]+)*'
157+ captures:
158+ 1: keyword.symbol.fsharp
159+ 2: keyword.symbol.fsharp
160+ 3: entity.name.type.fsharp
161+ - match: (\*)\s*(\()
162+ captures:
163+ 1: keyword.symbol.fsharp
164+ 2: keyword.symbol.fsharp
165+ push:
166+ - match: '(\)\s*(([?[:alpha:]0-9''`^._ ]+))+)'
167+ captures:
168+ 1: keyword.symbol.fsharp
169+ 2: entity.name.type.fsharp
170+ pop: true
171+ - include: tuple_signature
172+ - match: '(\*)(\s*([?[:alpha:]0-9''`^._ ]+))*'
173+ captures:
174+ 1: keyword.symbol.fsharp
175+ 2: entity.name.type.fsharp
176+ - match: '(<(?![[:space:]]*\)))'
177+ captures:
178+ 1: keyword.symbol.fsharp
179+ push:
180+ - match: ((?<!:)>)
181+ captures:
182+ 1: keyword.symbol.fsharp
183+ pop: true
184+ - include: generic_declaration
185+ - match: "({)"
186+ captures:
187+ 1: keyword.symbol.fsharp
188+ push:
189+ - match: "(})"
190+ captures:
191+ 1: keyword.symbol.fsharp
192+ pop: true
193+ - include: record_signature
194+ - include: definition
195+ - include: variables
196+ - include: keywords
197+ common_declaration:
198+ - match: '\s*(->)\s*([[:alpha:]0-9''`^._ ]+)(<)'
199+ captures:
200+ 1: keyword.symbol.fsharp
201+ 2: entity.name.type.fsharp
202+ 3: keyword.symbol.fsharp
203+ push:
204+ - match: (>)
205+ captures:
206+ 1: keyword.symbol.fsharp
207+ pop: true
208+ - match: "([[:alpha:]0-9'`^._ ]+)"
209+ captures:
210+ 1: entity.name.type.fsharp
211+ - include: keywords
212+ - match: '\s*(->)\s*(?!with|get|set\b)\b([\w0-9''`^._]+)'
213+ captures:
214+ 1: keyword.symbol.fsharp
215+ 2: entity.name.type.fsharp
216+ - match: '(\?{0,1})([[:alpha:]0-9''`^._ ]+)\s*(:)(\s*([?[:alpha:]0-9''`^._ ]+)(<))'
217+ captures:
218+ 1: keyword.symbol.fsharp
219+ 2: variable.parameter.fsharp
220+ 3: keyword.symbol.fsharp
221+ 4: keyword.symbol.fsharp
222+ 5: entity.name.type.fsharp
223+ push:
224+ - match: (>)
225+ captures:
226+ 1: keyword.symbol.fsharp
227+ pop: true
228+ - match: "([[:alpha:]0-9'`^._ ]+)"
229+ captures:
230+ 1: entity.name.type.fsharp
231+ - include: keywords
232+ compiler_directives:
233+ - match: \s?(#if|#elif|#else|#elseif|#endif|#light|#nowarn)
234+ scope: compiler_directive.fsharp
235+ captures:
69 constants:
236 constants:
70 - match: \(\)
237 - match: \(\)
71 scope: constant.language.unit.fsharp
238 scope: constant.language.unit.fsharp
@@ -73,123 +240,349 @@ contexts:
73 scope: constant.numeric.floating-point.fsharp
240 scope: constant.numeric.floating-point.fsharp
74 - match: '\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))'
241 - match: '\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))'
75 scope: constant.numeric.integer.nativeint.fsharp
242 scope: constant.numeric.integer.nativeint.fsharp
243+ - match: \b(true|false|null|unit)\b
244+ scope: constant.others.fsharp
76 definition:
245 definition:
77− - match: '\b(val|val|let|and|member|override|use)\s?(rec|inline|mutable)?(\s+\(?([a-zA-Z.\|_][a-zA-Z0-9.|_]*)\)?\w*)\b'
246+ - match: '\b(let mutable|static let mutable|let inline|let|member val|static member inline|static member|default|member|override|let!)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?'
247+ captures:
248+ 1: keyword.fsharp
249+ 2: keyword.fsharp
250+ 3: support.function.attribute.fsharp
251+ 4: keyword.fsharp
252+ 5: variable.fsharp
253+ push:
254+ - meta_scope: binding.fsharp
255+ - match: \s*(with\b|=|\n+=|(?<=\=))
256+ captures:
257+ 1: keyword.fsharp
258+ pop: true
259+ - include: common_binding_definition
260+ - match: '\b(static val mutable|val mutable|val)(\s+rec|mutable)?(\s+\[\<.*\>\])?\s*(private|internal|public)?\s+(\[[^-=]*\]|[_[:alpha:]]([_[:alpha:]0-9,\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9,\._`\s]+|(?<=,)\s)*)?'
261+ captures:
262+ 1: keyword.fsharp
263+ 2: keyword.fsharp
264+ 3: support.function.attribute.fsharp
265+ 4: keyword.fsharp
266+ 5: variable.fsharp
267+ push:
268+ - meta_scope: binding.fsharp
269+ - match: \n$
270+ pop: true
271+ - include: common_binding_definition
272+ double_tick:
273+ - match: (``)(.*)(``)
274+ scope: variable.other.binding.fsharp
275+ captures:
276+ 1: string.quoted.single.fsharp
277+ 2: variable.other.binding.fsharp
278+ 3: string.quoted.single.fsharp
279+ du_declaration:
280+ - match: \b(of)\b
281+ captures:
282+ 1: keyword.fsharp
283+ push:
284+ - meta_scope: du_declaration.fsharp
285+ - match: $|(\|)
286+ captures:
287+ 1: keyword.symbol.fsharp
288+ pop: true
289+ - include: comments
290+ - match: '([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)'
291+ captures:
292+ 1: variable.parameter.fsharp
293+ 2: keyword.symbol.fsharp
294+ 3: entity.name.type.fsharp
295+ - match: "([[:alpha:]0-9'`^._]+)|``([[:alpha:]0-9'^._ ]+)``"
296+ captures:
297+ 1: entity.name.type.fsharp
298+ - include: keywords
299+ generic_declaration:
300+ - match: (:)\s*(\()\s*(static member|member)
78 captures:
301 captures:
79− 1: keyword.other.binding.fsharp
302+ 1: keyword.symbol.fsharp
80− 2: keyword.other.function-recursive.fsharp
303+ 2: keyword.symbol.fsharp
81− 3: variable.other.binding.fsharp
304+ 3: keyword.fsharp
82 push:
305 push:
83− - meta_scope: meta.binding.fsharp
84− - match: "=|$"
306+ - match: (\))
85 captures:
307 captures:
86− 1: punctuation.separator.function.type-constraint.fsharp
308+ 1: keyword.symbol.fsharp
87 pop: true
309 pop: true
310+ - match: (\()
311+ captures:
312+ 1: keyword.symbol.fsharp
313+ push:
314+ - match: (\))
315+ captures:
316+ 1: keyword.symbol.fsharp
317+ pop: true
318+ - include: member_declaration
319+ - match: '((''|\^)[[:alpha:]0-9''._]+)'
320+ captures:
321+ 1: entity.name.type.fsharp
88 - include: variables
322 - include: variables
89− - match: \b(let)\s+((\(\))|(_))\s+=
323+ - include: keywords
90− scope: meta.expression.fsharp
324+ - match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|use|use\!|struct|while|mutable)(?!')\b
325+ scope: keyword.fsharp
326+ - match: ":"
327+ scope: keyword.fsharp
328+ - include: constants
329+ - match: '((''|\^)[[:alpha:]0-9''._]+)'
91 captures:
330 captures:
92− 1: keyword.other.binding.fsharp
331+ 1: entity.name.type.fsharp
93− 2: keyword.other.function-recursive.fsharp
332+ - match: (<)
94− 4: constant.language.unit.fsharp
333+ captures:
95− 5: constant.language.ignored.fsharp
334+ 1: keyword.symbol.fsharp
96− keywords:
97− - match: ^\s*#\s*(light|if|else|endif|r|I|load|time|help|quit)\b
98 push:
335 push:
99− - meta_scope: meta.preprocessor.fsharp
100− - match: (\s|$)
336+ - match: (>)
337+ captures:
338+ 1: keyword.symbol.fsharp
101 pop: true
339 pop: true
102− - match: \b(new|in|as|if|then|else|elif|for|begin|end|match|with|type|inherit|true|false|null|do)\b
340+ - match: '((''|\^)[[:alpha:]0-9''._]+)'
341+ captures:
342+ 1: entity.name.type.fsharp
343+ - include: tuple_signature
344+ - include: generic_declaration
345+ - match: '(?!when|and|or\b)\b([\w0-9''`^._]+)'
346+ captures:
347+ 1: entity.name.type.fsharp
348+ - match: (\|)
349+ captures:
350+ 1: keyword.symbol.fsharp
351+ - include: keywords
352+ keywords:
353+ - match: \b(private|to|public|internal|function|yield!|yield|class|exception|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\!|return\!|return|interface|with|abstract|property|union|enum|member|try|finally|and|when|or|use|use\!|struct|while|mutable)(?!')\b
103− scope: keyword.other.fsharp
354+ scope: keyword.fsharp
104− - match: '(\|>|\|?>|\->|\<\-|:>|:|\[|\]|\;|\||_)'
355+ - match: '(&&&|\|\|\||\^\^\^|~~~|<<<|>>>|\|>|\->|\<\-|:>|:\?>|:|\[|\]|\;|<>|=|@|\|\||&&|{|}|\||_|\.\.|\,|\+|\-|\*|\/|\^|\!|\>|\>\=|\>\>|\<|\<\=|\(|\)|\<\<)'
105− scope: entity.name
356+ scope: keyword.symbol.fsharp
106− method_calls:
357+ member_declaration:
107− - match: '(?<!\w)([a-z]\w*)(\.)'
358+ - include: comments
359+ - include: common_declaration
360+ - match: (:)\s*(\()\s*(static member|member)
361+ captures:
362+ 1: keyword.symbol.fsharp
363+ 2: keyword.symbol.fsharp
364+ 3: keyword.fsharp
108 push:
365 push:
109− - meta_scope: meta.method-call.fsharp
110− - match: '[A-Z]\w*(\.)'
366+ - match: (\))\s*((?=,)|(?=\=))
111− scope: meta.method.fsharp
112 captures:
367 captures:
113− 1: punctuation.separator.method-call.fsharp
368+ 1: keyword.symbol.fsharp
114− - match: (?=.)
115 pop: true
369 pop: true
370+ - match: (\()
371+ captures:
372+ 1: keyword.symbol.fsharp
373+ push:
374+ - match: (\))
375+ captures:
376+ 1: keyword.symbol.fsharp
377+ pop: true
378+ - include: member_declaration
379+ - match: '(\^[[:alpha:]0-9''._]+)'
380+ captures:
381+ 1: entity.name.type.fsharp
382+ - include: variables
383+ - include: keywords
384+ - match: '(\^[[:alpha:]0-9''._]+)'
385+ captures:
386+ 1: entity.name.type.fsharp
387+ - match: \b(and|when|or)\b
388+ scope: keyword.fsharp
389+ - match: (\(|\))
390+ scope: keyword.symbol.fsharp
391+ - match: '(\?{0,1})([[:alpha:]0-9''`^._]+|``[[:alpha:]0-9''`^:,._ ]+``)\s*(:{0,1})(\s*([?[:alpha:]0-9''`<>._ ]+)){0,1}'
392+ captures:
393+ 1: keyword.symbol.fsharp
394+ 2: variable.parameter.fsharp
395+ 3: keyword.symbol.fsharp
396+ 4: entity.name.type.fsharp
397+ - include: keywords
116 modules:
398 modules:
117− - match: '\b(namespace|module)\s+([a-zA-Z][a-zA-Z0-9''_.]*)'
399+ - match: '\b(namespace|module)\s*(public|internal|private)?\s+([[:alpha:]][[:alpha:]0-9''_. ]*)'
400+ captures:
401+ 1: keyword.fsharp
402+ 2: keyword.fsharp
403+ 3: entity.name.section.fsharp
404+ push:
405+ - meta_scope: entity.name.section.fsharp
406+ - match: (\s?=|\s|$)
407+ captures:
408+ 1: keyword.symbol.fsharp
409+ pop: true
410+ - match: '(\.)([A-Z][[:alpha:]0-9''_]*)'
411+ scope: entity.name.section.fsharp
412+ captures:
413+ 1: punctuation.separator.namespace-reference.fsharp
414+ 2: entity.name.section.fsharp
415+ - match: '\b(open)\s+([[:alpha:]][[:alpha:]0-9''_]*)(?=(\.[A-Z][[:alpha:]0-9_]*)*)'
118 captures:
416 captures:
119− 1: keyword.other.fsharp
417+ 1: keyword.fsharp
120 2: entity.name.section.fsharp
418 2: entity.name.section.fsharp
121 push:
419 push:
122− - meta_scope: meta.module.namespace.fsharp
420+ - meta_scope: namespace.open.fsharp
123 - match: (\s|$)
421 - match: (\s|$)
124 pop: true
422 pop: true
125− - match: '(\.)([A-Z][a-zA-Z0-9''_]*)'
423+ - match: '(\.)([[:alpha:]][[:alpha:]0-9''_]*)'
126− scope: support.other.module.fsharp
424+ scope: entity.name.section.fsharp
127 captures:
425 captures:
128− 1: punctuation.separator.module-reference.fsharp
426+ 1: punctuation.separator.namespace-reference.fsharp
129− 2: support.other.module.fsharp
427+ 2: entity.name.section.fsharp
130− - match: '\b(open)\s+([A-Z][a-zA-Z0-9''_]*)(?=(\.[A-Z][a-zA-Z0-9_]*)*)'
428+ - match: '^\s*(module)\s+([A-Z][[:alpha:]0-9''_]*)\s*(=)\s*([A-Z][[:alpha:]0-9''_]*)'
131 captures:
429 captures:
132− 1: keyword.other.fsharp
430+ 1: keyword.fsharp
133− 2: support.other.module.fsharp
431+ 2: entity.name.type.namespace.fsharp
432+ 3: punctuation.separator.namespace-definition.fsharp
433+ 4: entity.name.section.fsharp
134 push:
434 push:
135− - meta_scope: meta.module.open.fsharp
435+ - meta_scope: namespace.alias.fsharp
136 - match: (\s|$)
436 - match: (\s|$)
137 pop: true
437 pop: true
138− - match: '(\.)([A-Z][a-zA-Z0-9''_]*)'
438+ - match: '(\.)([A-Z][[:alpha:]0-9''_]*)'
139− scope: support.other.module.fsharp
439+ scope: entity.name.section.fsharp
140 captures:
440 captures:
141− 1: punctuation.separator.module-reference.fsharp
441+ 1: punctuation.separator.namespace-reference.fsharp
142− 2: support.other.module.fsharp
442+ 2: entity.name.section.fsharp
143− - match: '^\s*(module)\s+([A-Z][a-zA-Z0-9''_]*)\s*(=)\s*([A-Z][a-zA-Z0-9''_]*)'
443+ record_declaration:
444+ - match: '(\{)'
144 captures:
445 captures:
145− 1: keyword.other.module-definition.fsharp
446+ 1: keyword.symbol.fsharp
146− 2: entity.name.type.module.fsharp
147− 3: punctuation.separator.module-definition.fsharp
148− 4: support.other.module.fsharp
149 push:
447 push:
150− - meta_scope: meta.module.alias.fsharp
151− - match: (\s|$)
448+ - match: '(?<=\})'
152 pop: true
449 pop: true
153− - match: '(\.)([A-Z][a-zA-Z0-9''_]*)'
450+ - include: comments
154− scope: support.other.module.fsharp
451+ - match: '(((mutable)\s[[:alpha:]]+)|[[:alpha:]0-9''`<>^._]*)\s*((?<!:):(?!:))\s*'
155 captures:
452 captures:
156− 1: punctuation.separator.module-reference.fsharp
453+ 3: keyword.fsharp
157− 2: support.other.module.fsharp
454+ 4: keyword.symbol.fsharp
158− - match: '(?<!\w)([A-Z][a-zA-Z0-9_]*)(\.)'
455+ push:
456+ - match: '$|(;|\})'
457+ captures:
458+ 1: keyword.symbol.fsharp
459+ pop: true
460+ - include: comments
461+ - match: "([[:alpha:]0-9'`^_ ]+)"
462+ captures:
463+ 1: entity.name.type.fsharp
464+ - include: keywords
465+ - include: compiler_directives
466+ - include: constants
467+ - include: strings
468+ - include: chars
469+ - include: double_tick
470+ - include: definition
471+ - include: attributes
472+ - include: anonymous_functions
473+ - include: keywords
474+ - include: cexprs
475+ - include: text
476+ record_signature:
477+ - match: "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)"
159 captures:
478 captures:
160− 1: support.other.module.fsharp
479+ 1: keyword.symbol.fsharp
161− 2: punctuation.separator.module-reference.fsharp
480+ 2: variable.parameter.fsharp
481+ - match: "({)"
482+ captures:
483+ 1: keyword.symbol.fsharp
162 push:
484 push:
163− - meta_scope: meta.module.reference.fsharp
164− - match: '[A-Z][a-zA-Z0-9_]+(\.)'
485+ - match: "(})"
165− scope: support.other.module.fsharp
166 captures:
486 captures:
167− 1: punctuation.separator.module-reference.fsharp
487+ 1: keyword.symbol.fsharp
168− - match: (?=.)
169 pop: true
488 pop: true
489+ - match: "[[:alpha:]0-9'`^_ ]+(=)([[:alpha:]0-9'`^_ ]+)"
490+ captures:
491+ 1: keyword.symbol.fsharp
492+ 2: variable.parameter.fsharp
493+ - include: record_signature
494+ - include: keywords
495+ records:
496+ - match: '\b(type)[\s]+(private|internal|public)?\s*'
497+ captures:
498+ 1: keyword.fsharp
499+ 2: keyword.fsharp
500+ push:
501+ - meta_scope: record.fsharp
502+ - match: '\s*((with)|((as)\s+([[:alpha:]0-9'']+))|(=)|[\n=]|(\(\)))'
503+ captures:
504+ 2: keyword.fsharp
505+ 3: keyword.fsharp
506+ 4: keyword.fsharp
507+ 5: variable.parameter.fsharp
508+ 6: keyword.symbol.fsharp
509+ 7: constant.language.unit.fsharp
510+ pop: true
511+ - include: comments
512+ - include: attributes
513+ - match: "([[:alpha:]0-9'^._]+|``[[:alpha:]0-9'`^:,._ ]+``)"
514+ captures:
515+ 1: entity.name.type.fsharp
516+ - match: (<)
517+ captures:
518+ 1: keyword.fsharp
519+ push:
520+ - match: ((?<!:)>)
521+ captures:
522+ 1: keyword.fsharp
523+ pop: true
524+ - match: '((''|\^)``[[:alpha:]0-9`^:,._ ]+``|(''|\^)[[:alpha:]0-9`^:._]+)'
525+ captures:
526+ 1: entity.name.type.fsharp
527+ - match: \b(interface|with|abstract|and|when|or|not|struct|equality|comparison|unmanaged|delegate|enum)\b
528+ scope: keyword.fsharp
529+ - match: (\()
530+ captures:
531+ 1: keyword.symbol.fsharp
532+ push:
533+ - match: (\))
534+ captures:
535+ 1: keyword.symbol.fsharp
536+ pop: true
537+ - match: (static member|member|new)
538+ captures:
539+ 1: keyword.fsharp
540+ - include: common_binding_definition
541+ - match: '([\w0-9''`^._]+)'
542+ captures:
543+ 1: entity.name.type.fsharp
544+ - include: keywords
545+ - match: \s*(private|internal|public)
546+ captures:
547+ 1: keyword.symbol.fsharp
548+ 2: keyword.fsharp
549+ - match: (\()
550+ captures:
551+ 1: keyword.symbol.fsharp
552+ push:
553+ - match: '\s*(?=(=)|[\n=]|(\(\))|(as))'
554+ captures:
555+ 1: keyword.symbol.fsharp
556+ pop: true
557+ - include: member_declaration
558+ - include: keywords
559+ string_formatter:
560+ - match: (%0?-?(\d+)?((a|t)|(\.\d+)?(f|F|e|E|g|G|M)|(b|c|s|d|i|x|X|o|u)|(s|b|O)|(\+?A)))
561+ scope: entity.name.type.format.specifier.fsharp
562+ captures:
563+ 1: keyword.format.specifier.fsharp
170 strings:
564 strings:
171− - match: '(?=[^\\])(""")'
565+ - match: '(?=[^\\])(@")'
172 captures:
566 captures:
173 1: punctuation.definition.string.begin.fsharp
567 1: punctuation.definition.string.begin.fsharp
174 push:
568 push:
175− - meta_scope: string.quoted.double.fsharp
569+ - meta_scope: string.quoted.literal.fsharp
176− - match: (""")
570+ - match: (")(?!")
177 captures:
571 captures:
178 1: punctuation.definition.string.end.fsharp
572 1: punctuation.definition.string.end.fsharp
179 pop: true
573 pop: true
180− - match: '\\$[ \t]*'
574+ - match: '"(")'
181− scope: punctuation.separator.string.ignore-eol.fsharp
575+ scope: constant.character.string.escape.fsharp
182− - match: '(?=[^\\])(@")'
576+ - match: '(?=[^\\])(""")'
183 captures:
577 captures:
184 1: punctuation.definition.string.begin.fsharp
578 1: punctuation.definition.string.begin.fsharp
185 push:
579 push:
186− - meta_scope: string.quoted.double.fsharp
580+ - meta_scope: string.quoted.triple.fsharp
187− - match: (")
581+ - match: (""")
188 captures:
582 captures:
189 1: punctuation.definition.string.end.fsharp
583 1: punctuation.definition.string.end.fsharp
190 pop: true
584 pop: true
191− - match: '\\$[ \t]*'
585+ - include: string_formatter
192− scope: punctuation.separator.string.ignore-eol.fsharp
193 - match: '(?=[^\\])(")'
586 - match: '(?=[^\\])(")'
194 captures:
587 captures:
195 1: punctuation.definition.string.begin.fsharp
588 1: punctuation.definition.string.begin.fsharp
@@ -201,34 +594,79 @@ contexts:
201 pop: true
594 pop: true
202 - match: '\\$[ \t]*'
595 - match: '\\$[ \t]*'
203 scope: punctuation.separator.string.ignore-eol.fsharp
596 scope: punctuation.separator.string.ignore-eol.fsharp
204− - match: '\\([\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})'
597+ - match: '\\([\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})'
205 scope: constant.character.string.escape.fsharp
598 scope: constant.character.string.escape.fsharp
206− - match: '\\(?![\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).'
599+ - match: '\\(?![\\''''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).'
207 scope: invalid.illeagal.character.string.fsharp
600 scope: invalid.illeagal.character.string.fsharp
601+ - include: string_formatter
602+ strp_inlined:
208− - match: '(?=[^\\])('')'
603+ - match: (\()
209 captures:
604 captures:
210− 1: punctuation.definition.string.begin.fsharp
605+ 1: keyword.symbol.fsharp
211 push:
606 push:
212− - meta_scope: string.quoted.double.fsharp
213− - match: (')
607+ - match: (\))
214 captures:
608 captures:
215− 1: punctuation.definition.string.end.fsharp
609+ 1: keyword.symbol.fsharp
216 pop: true
610 pop: true
217− - match: '\\$[ \t]*'
611+ - include: strp_inlined_body
218− scope: punctuation.separator.string.ignore-eol.fsharp
612+ strp_inlined_body:
219− - match: '\\([\\"ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})'
613+ - include: comments
220− scope: constant.character.string.escape.fsharp
614+ - include: anonymous_functions
221− - match: '\\(?![\\"ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).'
615+ - match: '(\^[[:alpha:]0-9''._]+)'
222− scope: invalid.illeagal.character.string.fsharp
616+ captures:
223− structure:
617+ 1: entity.name.type.fsharp
618+ - match: \b(and|when|or)\b
619+ scope: keyword.fsharp
224− - match: \(
620+ - match: (\()
621+ captures:
622+ 1: keyword.symbol.fsharp
225 push:
623 push:
226− - meta_scope: meta.paren-group.fsharp
227− - match: \)
624+ - match: (\))
625+ captures:
626+ 1: keyword.symbol.fsharp
228 pop: true
627 pop: true
229− - include: main
628+ - include: strp_inlined_body
629+ - match: '(static member|member)\s*([[:alpha:]0-9''`<>^._]+|``[[:alpha:]0-9'' <>^._]+``)\s*(:)'
630+ captures:
631+ 1: keyword.fsharp
632+ 2: variable.fsharp
633+ 3: keyword.symbol.fsharp
634+ - include: compiler_directives
635+ - include: constants
636+ - include: strings
637+ - include: chars
638+ - include: double_tick
639+ - include: keywords
640+ - include: text
641+ - include: definition
642+ - include: attributes
643+ - include: keywords
644+ - include: cexprs
645+ - include: text
646+ text:
647+ - match: \\
648+ scope: text.fsharp
649+ tuple_signature:
650+ - match: "(([?[:alpha:]0-9'`^._ ]+))+"
651+ captures:
652+ 1: entity.name.type.fsharp
653+ - match: (\()
654+ captures:
655+ 1: keyword.symbol.fsharp
656+ push:
657+ - match: (\))
658+ captures:
659+ 1: keyword.symbol.fsharp
660+ pop: true
661+ - match: "(([?[:alpha:]0-9'`^._ ]+))+"
662+ captures:
663+ 1: entity.name.type.fsharp
664+ - include: tuple_signature
665+ - include: keywords
230 variables:
666 variables:
231 - match: \(\)
667 - match: \(\)
232− scope: variable.parameter.unit.fsharp
668+ scope: constant.language.unit.fsharp
233− - match: '[a-zA-Z]\w*'
669+ - match: '(\?{0,1})(``[[:alpha:]0-9''`^:,._ ]+``|[[:alpha:]0-9''`<>^._ ]\w*)'
670+ captures:
671+ 1: keyword.symbol.fsharp
234− scope: variable.parameter.fsharp
672+ 2: variable.parameter.fsharp