on master help sign in
Update F# syntax
commitc96927b550bec973091b7b0a2a0f359b6ea07b9c authorBjörn <bo@kbct.de> dateSat 23 Mar 2019, 15:10 (8 years ago) parent921cc0d
2 files changed+560−122
assets/syntaxes/FSharp+1−1 assets/syntaxes/FSharp.sublime-syntax+559−121
assets/syntaxes/FSharp+1−1

Submodule changed.

assets/syntaxes/FSharp.sublime-syntax+559−121
@@ -9,63 +9,230 @@ file_extensions:
99scope: source.fsharp
1010contexts:
1111 main:
12+ - include: compiler_directives
1213 - include: comments
1314 - include: constants
14− - include: structure
15− - include: attributes
1615 - include: strings
16+ - include: chars
17+ - include: double_tick
1718 - include: definition
18− - include: method_calls
19+ - include: abstract_definition
20+ - include: attributes
1921 - include: modules
2022 - include: anonymous_functions
23+ - include: du_declaration
24+ - include: record_declaration
25+ - include: records
26+ - include: strp_inlined
2127 - 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
2255 anonymous_functions:
2356 - match: \b(fun)\b
2457 captures:
25− 1: keyword.other.function-definition.fsharp
58+ 1: keyword.fsharp
2659 push:
27− - meta_scope: meta.function.anonymous
60+ - meta_scope: function.anonymous
2861 - match: (->)
2962 captures:
30− 1: keyword.other.fsharp
63+ 1: keyword.fsharp
3164 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
3275 - include: variables
3376 attributes:
3477 - match: '\[\<'
3578 push:
3679 - meta_scope: support.function.attribute.fsharp
37− - match: '\>\]'
80+ - match: '\>\]|\]'
3881 pop: true
3982 - include: main
40− characters:
41− - match: (')
83+ cexprs:
84+ - match: '\b(async|seq|promise|task|maybe|asyncMaybe|controller|scope|application|pipeline)\s*\{'
85+ scope: cexpr.fsharp
4286 captures:
43− 1: punctuation.definition.string.begin.fsharp
44− push:
45− - meta_scope: 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
87+ 0: keyword.fsharp
88+ chars:
89+ - match: ('\\?.')
90+ scope: char.fsharp
91+ captures:
92+ 1: string.quoted.single.fsharp
5693 comments:
57− - match: \(\*\*?(\*)\)
58− scope: comment.block.fsharp
94+ - match: (\(\*(?!\)))
5995 captures:
60− 1: comment.block.empty.fsharp
61− - match: '\(\*[^\)]'
96+ 1: comment.block.fsharp
6297 push:
6398 - meta_scope: comment.block.fsharp
64− - match: \*\)
99+ - match: (\*\))
100+ captures:
101+ 1: comment.block.fsharp
65102 pop: true
66− - include: comments
67103 - match: //.*$
68104 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:
69236 constants:
70237 - match: \(\)
71238 scope: constant.language.unit.fsharp
@@ -73,123 +240,349 @@ contexts:
73240 scope: constant.numeric.floating-point.fsharp
74241 - 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_]*)))'
75242 scope: constant.numeric.integer.nativeint.fsharp
243+ - match: \b(true|false|null|unit)\b
244+ scope: constant.others.fsharp
76245 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)
78301 captures:
79− 1: keyword.other.binding.fsharp
80− 2: keyword.other.function-recursive.fsharp
81− 3: variable.other.binding.fsharp
302+ 1: keyword.symbol.fsharp
303+ 2: keyword.symbol.fsharp
304+ 3: keyword.fsharp
82305 push:
83− - meta_scope: meta.binding.fsharp
84− - match: "=|$"
306+ - match: (\))
85307 captures:
86− 1: punctuation.separator.function.type-constraint.fsharp
308+ 1: keyword.symbol.fsharp
87309 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
88322 - include: variables
89− - match: \b(let)\s+((\(\))|(_))\s+=
90− scope: meta.expression.fsharp
323+ - include: keywords
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''._]+)'
91330 captures:
92− 1: keyword.other.binding.fsharp
93− 2: keyword.other.function-recursive.fsharp
94− 4: constant.language.unit.fsharp
95− 5: constant.language.ignored.fsharp
96− keywords:
97− - match: ^\s*#\s*(light|if|else|endif|r|I|load|time|help|quit)\b
331+ 1: entity.name.type.fsharp
332+ - match: (<)
333+ captures:
334+ 1: keyword.symbol.fsharp
98335 push:
99− - meta_scope: meta.preprocessor.fsharp
100− - match: (\s|$)
336+ - match: (>)
337+ captures:
338+ 1: keyword.symbol.fsharp
101339 pop: true
102− - match: \b(new|in|as|if|then|else|elif|for|begin|end|match|with|type|inherit|true|false|null|do)\b
103− scope: keyword.other.fsharp
104− - match: '(\|>|\|?>|\->|\<\-|:>|:|\[|\]|\;|\||_)'
105− scope: entity.name
106− method_calls:
107− - match: '(?<!\w)([a-z]\w*)(\.)'
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
354+ scope: keyword.fsharp
355+ - match: '(&&&|\|\|\||\^\^\^|~~~|<<<|>>>|\|>|\->|\<\-|:>|:\?>|:|\[|\]|\;|<>|=|@|\|\||&&|{|}|\||_|\.\.|\,|\+|\-|\*|\/|\^|\!|\>|\>\=|\>\>|\<|\<\=|\(|\)|\<\<)'
356+ scope: keyword.symbol.fsharp
357+ member_declaration:
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
108365 push:
109− - meta_scope: meta.method-call.fsharp
110− - match: '[A-Z]\w*(\.)'
111− scope: meta.method.fsharp
366+ - match: (\))\s*((?=,)|(?=\=))
112367 captures:
113− 1: punctuation.separator.method-call.fsharp
114− - match: (?=.)
368+ 1: keyword.symbol.fsharp
115369 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
116398 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_]*)*)'
118416 captures:
119− 1: keyword.other.fsharp
417+ 1: keyword.fsharp
120418 2: entity.name.section.fsharp
121419 push:
122− - meta_scope: meta.module.namespace.fsharp
420+ - meta_scope: namespace.open.fsharp
123421 - match: (\s|$)
124422 pop: true
125− - match: '(\.)([A-Z][a-zA-Z0-9''_]*)'
126− scope: support.other.module.fsharp
423+ - match: '(\.)([[:alpha:]][[:alpha:]0-9''_]*)'
424+ scope: entity.name.section.fsharp
127425 captures:
128− 1: punctuation.separator.module-reference.fsharp
129− 2: support.other.module.fsharp
130− - match: '\b(open)\s+([A-Z][a-zA-Z0-9''_]*)(?=(\.[A-Z][a-zA-Z0-9_]*)*)'
426+ 1: punctuation.separator.namespace-reference.fsharp
427+ 2: entity.name.section.fsharp
428+ - match: '^\s*(module)\s+([A-Z][[:alpha:]0-9''_]*)\s*(=)\s*([A-Z][[:alpha:]0-9''_]*)'
131429 captures:
132− 1: keyword.other.fsharp
133− 2: support.other.module.fsharp
430+ 1: keyword.fsharp
431+ 2: entity.name.type.namespace.fsharp
432+ 3: punctuation.separator.namespace-definition.fsharp
433+ 4: entity.name.section.fsharp
134434 push:
135− - meta_scope: meta.module.open.fsharp
435+ - meta_scope: namespace.alias.fsharp
136436 - match: (\s|$)
137437 pop: true
138− - match: '(\.)([A-Z][a-zA-Z0-9''_]*)'
139− scope: support.other.module.fsharp
438+ - match: '(\.)([A-Z][[:alpha:]0-9''_]*)'
439+ scope: entity.name.section.fsharp
140440 captures:
141− 1: punctuation.separator.module-reference.fsharp
142− 2: support.other.module.fsharp
143− - match: '^\s*(module)\s+([A-Z][a-zA-Z0-9''_]*)\s*(=)\s*([A-Z][a-zA-Z0-9''_]*)'
441+ 1: punctuation.separator.namespace-reference.fsharp
442+ 2: entity.name.section.fsharp
443+ record_declaration:
444+ - match: '(\{)'
144445 captures:
145− 1: keyword.other.module-definition.fsharp
146− 2: entity.name.type.module.fsharp
147− 3: punctuation.separator.module-definition.fsharp
148− 4: support.other.module.fsharp
446+ 1: keyword.symbol.fsharp
149447 push:
150− - meta_scope: meta.module.alias.fsharp
151− - match: (\s|$)
448+ - match: '(?<=\})'
152449 pop: true
153− - match: '(\.)([A-Z][a-zA-Z0-9''_]*)'
154− scope: support.other.module.fsharp
450+ - include: comments
451+ - match: '(((mutable)\s[[:alpha:]]+)|[[:alpha:]0-9''`<>^._]*)\s*((?<!:):(?!:))\s*'
155452 captures:
156− 1: punctuation.separator.module-reference.fsharp
157− 2: support.other.module.fsharp
158− - match: '(?<!\w)([A-Z][a-zA-Z0-9_]*)(\.)'
453+ 3: keyword.fsharp
454+ 4: keyword.symbol.fsharp
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'`^_ ]+)"
159478 captures:
160− 1: support.other.module.fsharp
161− 2: punctuation.separator.module-reference.fsharp
479+ 1: keyword.symbol.fsharp
480+ 2: variable.parameter.fsharp
481+ - match: "({)"
482+ captures:
483+ 1: keyword.symbol.fsharp
162484 push:
163− - meta_scope: meta.module.reference.fsharp
164− - match: '[A-Z][a-zA-Z0-9_]+(\.)'
165− scope: support.other.module.fsharp
485+ - match: "(})"
166486 captures:
167− 1: punctuation.separator.module-reference.fsharp
168− - match: (?=.)
487+ 1: keyword.symbol.fsharp
169488 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
170564 strings:
171− - match: '(?=[^\\])(""")'
565+ - match: '(?=[^\\])(@")'
172566 captures:
173567 1: punctuation.definition.string.begin.fsharp
174568 push:
175− - meta_scope: string.quoted.double.fsharp
176− - match: (""")
569+ - meta_scope: string.quoted.literal.fsharp
570+ - match: (")(?!")
177571 captures:
178572 1: punctuation.definition.string.end.fsharp
179573 pop: true
180− - match: '\\$[ \t]*'
181− scope: punctuation.separator.string.ignore-eol.fsharp
182− - match: '(?=[^\\])(@")'
574+ - match: '"(")'
575+ scope: constant.character.string.escape.fsharp
576+ - match: '(?=[^\\])(""")'
183577 captures:
184578 1: punctuation.definition.string.begin.fsharp
185579 push:
186− - meta_scope: string.quoted.double.fsharp
187− - match: (")
580+ - meta_scope: string.quoted.triple.fsharp
581+ - match: (""")
188582 captures:
189583 1: punctuation.definition.string.end.fsharp
190584 pop: true
191− - match: '\\$[ \t]*'
192− scope: punctuation.separator.string.ignore-eol.fsharp
585+ - include: string_formatter
193586 - match: '(?=[^\\])(")'
194587 captures:
195588 1: punctuation.definition.string.begin.fsharp
@@ -201,34 +594,79 @@ contexts:
201594 pop: true
202595 - match: '\\$[ \t]*'
203596 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})'
205598 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}).'
207600 scope: invalid.illeagal.character.string.fsharp
208− - match: '(?=[^\\])('')'
601+ - include: string_formatter
602+ strp_inlined:
603+ - match: (\()
209604 captures:
210− 1: punctuation.definition.string.begin.fsharp
605+ 1: keyword.symbol.fsharp
211606 push:
212− - meta_scope: string.quoted.double.fsharp
213− - match: (')
607+ - match: (\))
214608 captures:
215− 1: punctuation.definition.string.end.fsharp
609+ 1: keyword.symbol.fsharp
216610 pop: true
217− - match: '\\$[ \t]*'
218− scope: punctuation.separator.string.ignore-eol.fsharp
219− - match: '\\([\\"ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})'
220− scope: constant.character.string.escape.fsharp
221− - match: '\\(?![\\"ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8}).'
222− scope: invalid.illeagal.character.string.fsharp
223− structure:
224− - match: \(
611+ - include: strp_inlined_body
612+ strp_inlined_body:
613+ - include: comments
614+ - include: anonymous_functions
615+ - match: '(\^[[:alpha:]0-9''._]+)'
616+ captures:
617+ 1: entity.name.type.fsharp
618+ - match: \b(and|when|or)\b
619+ scope: keyword.fsharp
620+ - match: (\()
621+ captures:
622+ 1: keyword.symbol.fsharp
225623 push:
226− - meta_scope: meta.paren-group.fsharp
227− - match: \)
624+ - match: (\))
625+ captures:
626+ 1: keyword.symbol.fsharp
228627 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
230666 variables:
231667 - match: \(\)
232− scope: variable.parameter.unit.fsharp
233− - match: '[a-zA-Z]\w*'
234− scope: variable.parameter.fsharp
668+ scope: constant.language.unit.fsharp
669+ - match: '(\?{0,1})(``[[:alpha:]0-9''`^:,._ ]+``|[[:alpha:]0-9''`<>^._ ]\w*)'
670+ captures:
671+ 1: keyword.symbol.fsharp
672+ 2: variable.parameter.fsharp