github-linguist-grammars 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/grammars/file.lasso.json +713 -0
- data/grammars/module.ceylon.json +54 -0
- data/grammars/objdump.x86asm.json +73 -0
- data/grammars/source.Inform7.json +45 -0
- data/grammars/source.Kotlin.json +774 -0
- data/grammars/source.LS.json +104 -0
- data/grammars/source.MCPOST.json +68 -0
- data/grammars/source.MOD.json +70 -0
- data/grammars/source.abap.json +176 -0
- data/grammars/source.abl.json +138 -0
- data/grammars/source.actionscript.3.json +1571 -0
- data/grammars/source.acucobol.json +16 -0
- data/grammars/source.ada.json +140 -0
- data/grammars/source.agda.json +254 -0
- data/grammars/source.ahk.json +171 -0
- data/grammars/source.alloy.json +44 -0
- data/grammars/source.ampl.json +157 -0
- data/grammars/source.antlr.json +300 -0
- data/grammars/source.apache-config.json +352 -0
- data/grammars/source.apache-config.mod_perl.json +70 -0
- data/grammars/source.apl.json +442 -0
- data/grammars/source.applescript.json +1385 -0
- data/grammars/source.apt.json +25 -0
- data/grammars/source.asm.x86.json +182 -0
- data/grammars/source.asp.json +157 -0
- data/grammars/source.aspectj.json +963 -0
- data/grammars/source.ats.json +170 -0
- data/grammars/source.autoit.3.json +132 -0
- data/grammars/source.awk.json +388 -0
- data/grammars/source.befunge.json +38 -0
- data/grammars/source.bf.json +36 -0
- data/grammars/source.bison.json +59 -0
- data/grammars/source.blitzmax.json +912 -0
- data/grammars/source.boo.json +452 -0
- data/grammars/source.brightauthorproject.json +29 -0
- data/grammars/source.brightscript.json +158 -0
- data/grammars/source.bro.json +409 -0
- data/grammars/source.bsv.json +283 -0
- data/grammars/source.c++.json +364 -0
- data/grammars/source.c++.qt.json +37 -0
- data/grammars/source.c.ec.json +39 -0
- data/grammars/source.c.json +727 -0
- data/grammars/source.c.platform.json +154 -0
- data/grammars/source.cache.cmake.json +75 -0
- data/grammars/source.cake.json +16 -0
- data/grammars/source.camlp4.ocaml.json +63 -0
- data/grammars/source.capnp.json +93 -0
- data/grammars/source.ceylon.json +77 -0
- data/grammars/source.cfscript.cfc.json +170 -0
- data/grammars/source.cfscript.json +744 -0
- data/grammars/source.chapel.json +240 -0
- data/grammars/source.cirru.json +66 -0
- data/grammars/source.clarion.json +159 -0
- data/grammars/source.clips.json +80 -0
- data/grammars/source.clojure.json +397 -0
- data/grammars/source.cm.json +54 -0
- data/grammars/source.cmake.json +181 -0
- data/grammars/source.cobol.json +528 -0
- data/grammars/source.coffee.json +678 -0
- data/grammars/source.compiled-papyrus.json +11 -0
- data/grammars/source.cool.json +103 -0
- data/grammars/source.coq.json +62 -0
- data/grammars/source.crystal.json +2760 -0
- data/grammars/source.cs.json +556 -0
- data/grammars/source.css.json +630 -0
- data/grammars/source.css.less.json +276 -0
- data/grammars/source.css.mss.json +256 -0
- data/grammars/source.csx.json +16 -0
- data/grammars/source.cuda-c++.json +137 -0
- data/grammars/source.cython.json +2108 -0
- data/grammars/source.d.json +722 -0
- data/grammars/source.dart.json +763 -0
- data/grammars/source.desktop.json +90 -0
- data/grammars/source.diff.json +162 -0
- data/grammars/source.dockerfile.json +89 -0
- data/grammars/source.dosbatch.json +70 -0
- data/grammars/source.dot.json +126 -0
- data/grammars/source.dylan.json +217 -0
- data/grammars/source.eiffel.json +138 -0
- data/grammars/source.elixir.json +737 -0
- data/grammars/source.elm.json +355 -0
- data/grammars/source.erazor.json +126 -0
- data/grammars/source.erlang.json +1674 -0
- data/grammars/source.essl.json +50 -0
- data/grammars/source.factor.json +260 -0
- data/grammars/source.fan.json +188 -0
- data/grammars/source.fancy.json +270 -0
- data/grammars/source.fish.json +214 -0
- data/grammars/source.forth.json +101 -0
- data/grammars/source.fortran.json +499 -0
- data/grammars/source.fortran.modern.json +226 -0
- data/grammars/source.fsharp.json +403 -0
- data/grammars/source.gap.json +167 -0
- data/grammars/source.gcode.json +25 -0
- data/grammars/source.gdscript.json +154 -0
- data/grammars/source.gfm.json +1270 -0
- data/grammars/source.glsl.json +71 -0
- data/grammars/source.gnuplot.json +276 -0
- data/grammars/source.go.json +552 -0
- data/grammars/source.golo.json +182 -0
- data/grammars/source.gosu.2.json +163 -0
- data/grammars/source.grace.json +679 -0
- data/grammars/source.groovy.gradle.json +73 -0
- data/grammars/source.groovy.json +1385 -0
- data/grammars/source.harbour.json +450 -0
- data/grammars/source.haskell.json +449 -0
- data/grammars/source.haxe.2.json +1243 -0
- data/grammars/source.hss.1.json +464 -0
- data/grammars/source.httpspec.json +287 -0
- data/grammars/source.hxml.json +26 -0
- data/grammars/source.hy.json +270 -0
- data/grammars/source.idl-dlm.json +112 -0
- data/grammars/source.idl.json +267 -0
- data/grammars/source.idris.json +537 -0
- data/grammars/source.ini.json +113 -0
- data/grammars/source.inno.json +65 -0
- data/grammars/source.io.json +164 -0
- data/grammars/source.ioke.json +272 -0
- data/grammars/source.isabelle.root.json +68 -0
- data/grammars/source.isabelle.theory.json +106 -0
- data/grammars/source.j.json +49 -0
- data/grammars/source.jade.json +1009 -0
- data/grammars/source.jasmin.json +299 -0
- data/grammars/source.java-properties.json +97 -0
- data/grammars/source.java.json +1026 -0
- data/grammars/source.jcl.json +49 -0
- data/grammars/source.jflex.json +490 -0
- data/grammars/source.jq.json +218 -0
- data/grammars/source.js.json +948 -0
- data/grammars/source.js.jsx.json +2937 -0
- data/grammars/source.js.objj.json +424 -0
- data/grammars/source.js.regexp.json +150 -0
- data/grammars/source.js.regexp.replacement.json +30 -0
- data/grammars/source.json.json +149 -0
- data/grammars/source.julia.json +407 -0
- data/grammars/source.lean.json +145 -0
- data/grammars/source.lid.json +23 -0
- data/grammars/source.lilypond.json +623 -0
- data/grammars/source.lisp.json +111 -0
- data/grammars/source.litcoffee.json +669 -0
- data/grammars/source.livescript.json +616 -0
- data/grammars/source.llvm.json +71 -0
- data/grammars/source.logos.json +31 -0
- data/grammars/source.logtalk.json +315 -0
- data/grammars/source.loomscript.json +214 -0
- data/grammars/source.lsl.json +216 -0
- data/grammars/source.lua.json +191 -0
- data/grammars/source.makefile.json +474 -0
- data/grammars/source.makegen.json +13 -0
- data/grammars/source.man.json +53 -0
- data/grammars/source.mask.json +701 -0
- data/grammars/source.mata.json +133 -0
- data/grammars/source.mathematica.json +429 -0
- data/grammars/source.matlab.json +776 -0
- data/grammars/source.mercury.json +251 -0
- data/grammars/source.ml.json +291 -0
- data/grammars/source.modelica.json +142 -0
- data/grammars/source.modula2.json +103 -0
- data/grammars/source.monkey.json +701 -0
- data/grammars/source.moonscript.json +149 -0
- data/grammars/source.mupad.json +149 -0
- data/grammars/source.nant-build.json +86 -0
- data/grammars/source.ncl.json +66 -0
- data/grammars/source.nemerle.json +137 -0
- data/grammars/source.nesc.json +27 -0
- data/grammars/source.netlinx.erb.json +47 -0
- data/grammars/source.netlinx.json +768 -0
- data/grammars/source.nginx.json +797 -0
- data/grammars/source.nim.json +1150 -0
- data/grammars/source.nim_filter.json +133 -0
- data/grammars/source.nimcfg.json +116 -0
- data/grammars/source.ninja.json +66 -0
- data/grammars/source.nit.json +238 -0
- data/grammars/source.nix.json +1200 -0
- data/grammars/source.nmml.json +87 -0
- data/grammars/source.nsis.json +150 -0
- data/grammars/source.objc++.json +19 -0
- data/grammars/source.objc.json +918 -0
- data/grammars/source.objc.platform.json +277 -0
- data/grammars/source.ocaml.json +1426 -0
- data/grammars/source.ocamllex.json +305 -0
- data/grammars/source.ocamlyacc.json +346 -0
- data/grammars/source.octave.json +451 -0
- data/grammars/source.ooc.json +692 -0
- data/grammars/source.opa.json +206 -0
- data/grammars/source.opal.json +415 -0
- data/grammars/source.opalsysdefs.json +70 -0
- data/grammars/source.opencobol.json +65 -0
- data/grammars/source.ox.json +97 -0
- data/grammars/source.oz.json +84 -0
- data/grammars/source.papyrus-assembly.json +266 -0
- data/grammars/source.papyrus.json +231 -0
- data/grammars/source.parrot.pir.json +117 -0
- data/grammars/source.pascal.json +150 -0
- data/grammars/source.perl.6.json +310 -0
- data/grammars/source.perl.json +2413 -0
- data/grammars/source.php.zephir.json +362 -0
- data/grammars/source.pig_latin.json +172 -0
- data/grammars/source.pike.json +62 -0
- data/grammars/source.plsql.oracle.json +642 -0
- data/grammars/source.po.json +232 -0
- data/grammars/source.pogoscript.json +85 -0
- data/grammars/source.postscript.json +231 -0
- data/grammars/source.powershell.json +755 -0
- data/grammars/source.processing.json +885 -0
- data/grammars/source.prolog.eclipse.json +206 -0
- data/grammars/source.prolog.json +292 -0
- data/grammars/source.protobuf.json +395 -0
- data/grammars/source.pubspec.json +13 -0
- data/grammars/source.puppet.json +494 -0
- data/grammars/source.purescript.json +818 -0
- data/grammars/source.pyjade.json +1010 -0
- data/grammars/source.python.django.json +34 -0
- data/grammars/source.python.json +1960 -0
- data/grammars/source.python.salt.json +13 -0
- data/grammars/source.qmake.json +217 -0
- data/grammars/source.qml.json +195 -0
- data/grammars/source.r.json +203 -0
- data/grammars/source.racket.json +119 -0
- data/grammars/source.rebol.json +647 -0
- data/grammars/source.red.json +652 -0
- data/grammars/source.regexp.babel.json +190 -0
- data/grammars/source.regexp.python.json +187 -0
- data/grammars/source.regexp.spin.json +188 -0
- data/grammars/source.ruby.json +1956 -0
- data/grammars/source.ruby.rspec.cucumber.steps.json +274 -0
- data/grammars/source.rust.json +269 -0
- data/grammars/source.sas.json +322 -0
- data/grammars/source.sas_log.json +26 -0
- data/grammars/source.sass.json +248 -0
- data/grammars/source.sbt.json +36 -0
- data/grammars/source.scad.json +152 -0
- data/grammars/source.scala.json +739 -0
- data/grammars/source.scaml.json +466 -0
- data/grammars/source.scheme.json +370 -0
- data/grammars/source.scilab.json +103 -0
- data/grammars/source.scss.json +1321 -0
- data/grammars/source.shell.json +1212 -0
- data/grammars/source.smali.json +1668 -0
- data/grammars/source.smalltalk.json +135 -0
- data/grammars/source.smt.json +173 -0
- data/grammars/source.sp.json +118 -0
- data/grammars/source.sparql.json +23 -0
- data/grammars/source.spin.json +936 -0
- data/grammars/source.sqf.json +112 -0
- data/grammars/source.sql.json +473 -0
- data/grammars/source.stata.json +208 -0
- data/grammars/source.strings.json +53 -0
- data/grammars/source.stylus.json +1021 -0
- data/grammars/source.swift.json +965 -0
- data/grammars/source.systemverilog.json +1050 -0
- data/grammars/source.tcl.json +277 -0
- data/grammars/source.tea.json +180 -0
- data/grammars/source.thrift.json +704 -0
- data/grammars/source.toml.json +327 -0
- data/grammars/source.ts.json +1094 -0
- data/grammars/source.tsx.json +1324 -0
- data/grammars/source.turtle.json +505 -0
- data/grammars/source.txl.json +62 -0
- data/grammars/source.ucfconstraints.json +72 -0
- data/grammars/source.vala.json +814 -0
- data/grammars/source.varnish.vcl.json +343 -0
- data/grammars/source.vbnet.json +338 -0
- data/grammars/source.verilog.json +302 -0
- data/grammars/source.vhdl.json +1349 -0
- data/grammars/source.viml.json +224 -0
- data/grammars/source.webidl.json +814 -0
- data/grammars/source.x10.json +68 -0
- data/grammars/source.x86asm.json +47 -0
- data/grammars/source.xc.json +379 -0
- data/grammars/source.xq.json +241 -0
- data/grammars/source.xquery.json +193 -0
- data/grammars/source.xtend.json +733 -0
- data/grammars/source.yaml.json +334 -0
- data/grammars/source.yaml.salt.json +348 -0
- data/grammars/text.bibtex.json +251 -0
- data/grammars/text.cfml.basic.json +736 -0
- data/grammars/text.dart-analysis-output.json +162 -0
- data/grammars/text.dart-doccomments.json +19 -0
- data/grammars/text.elixir.json +45 -0
- data/grammars/text.gherkin.feature.json +135 -0
- data/grammars/text.groff.json +113 -0
- data/grammars/text.haml.json +299 -0
- data/grammars/text.html.abl.json +24 -0
- data/grammars/text.html.asciidoc.json +492 -0
- data/grammars/text.html.asdoc.json +541 -0
- data/grammars/text.html.asp.json +58 -0
- data/grammars/text.html.basic.json +552 -0
- data/grammars/text.html.cfm.json +811 -0
- data/grammars/text.html.creole.json +329 -0
- data/grammars/text.html.django.json +69 -0
- data/grammars/text.html.elixir.json +18 -0
- data/grammars/text.html.erb.json +157 -0
- data/grammars/text.html.erlang.yaws.json +72 -0
- data/grammars/text.html.factor.json +27 -0
- data/grammars/text.html.handlebars.json +783 -0
- data/grammars/text.html.jsp.json +1203 -0
- data/grammars/text.html.liquid.json +35 -0
- data/grammars/text.html.mako.json +729 -0
- data/grammars/text.html.markdown.source.gfm.apib.json +1297 -0
- data/grammars/text.html.markdown.source.gfm.mson.json +1165 -0
- data/grammars/text.html.mediawiki.json +972 -0
- data/grammars/text.html.php.json +2607 -0
- data/grammars/text.html.slash.json +313 -0
- data/grammars/text.html.smarty.json +216 -0
- data/grammars/text.html.ssp.json +49 -0
- data/grammars/text.html.tcl.json +44 -0
- data/grammars/text.html.twig.json +1353 -0
- data/grammars/text.html.vue.json +642 -0
- data/grammars/text.idl-idldoc.json +14 -0
- data/grammars/text.junit-test-report.json +92 -0
- data/grammars/text.log.latex.json +86 -0
- data/grammars/text.python.console.json +25 -0
- data/grammars/text.python.traceback.json +46 -0
- data/grammars/text.rdoc.json +48 -0
- data/grammars/text.restructuredtext.json +561 -0
- data/grammars/text.robot.json +73 -0
- data/grammars/text.shell-session.json +48 -0
- data/grammars/text.slim.json +527 -0
- data/grammars/text.tex.json +271 -0
- data/grammars/text.tex.latex.beamer.json +63 -0
- data/grammars/text.tex.latex.haskell.json +56 -0
- data/grammars/text.tex.latex.json +1013 -0
- data/grammars/text.tex.latex.memoir.json +99 -0
- data/grammars/text.tex.latex.rd.json +117 -0
- data/grammars/text.xml.ant.json +202 -0
- data/grammars/text.xml.flex-config.json +2634 -0
- data/grammars/text.xml.genshi.json +34 -0
- data/grammars/text.xml.json +364 -0
- data/grammars/text.xml.pom.json +774 -0
- data/grammars/text.xml.xsl.json +94 -0
- data/grammars/text.zone_file.json +72 -0
- data/lib/linguist/grammars.rb +13 -0
- metadata +389 -0
@@ -0,0 +1,965 @@
|
|
1
|
+
{
|
2
|
+
"fileTypes": [
|
3
|
+
"swift"
|
4
|
+
],
|
5
|
+
"firstLineMatch": "^#!/.*\\bswift",
|
6
|
+
"keyEquivalent": "^~S",
|
7
|
+
"name": "Swift",
|
8
|
+
"patterns": [
|
9
|
+
{
|
10
|
+
"include": "#shebang-line"
|
11
|
+
},
|
12
|
+
{
|
13
|
+
"include": "#comment"
|
14
|
+
},
|
15
|
+
{
|
16
|
+
"include": "#attribute"
|
17
|
+
},
|
18
|
+
{
|
19
|
+
"include": "#literal"
|
20
|
+
},
|
21
|
+
{
|
22
|
+
"include": "#operator"
|
23
|
+
},
|
24
|
+
{
|
25
|
+
"include": "#declaration"
|
26
|
+
},
|
27
|
+
{
|
28
|
+
"include": "#storage-type"
|
29
|
+
},
|
30
|
+
{
|
31
|
+
"include": "#keyword"
|
32
|
+
},
|
33
|
+
{
|
34
|
+
"include": "#type"
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"include": "#builtin-global-function"
|
38
|
+
},
|
39
|
+
{
|
40
|
+
"include": "#builtin-function"
|
41
|
+
},
|
42
|
+
{
|
43
|
+
"include": "#builtin-property"
|
44
|
+
},
|
45
|
+
{
|
46
|
+
"include": "#builtin-static-property"
|
47
|
+
},
|
48
|
+
{
|
49
|
+
"include": "#builtin-constant"
|
50
|
+
},
|
51
|
+
{
|
52
|
+
"include": "#section-punctuation"
|
53
|
+
}
|
54
|
+
],
|
55
|
+
"repository": {
|
56
|
+
"arithmetic-operator": {
|
57
|
+
"match": "(?<![/=\\-+!*%<>&|\\^~.])(\\+|\\-|\\*|\\/)(?![/=\\-+!*%<>&|\\^~.])",
|
58
|
+
"name": "keyword.operator.arithmetic.swift"
|
59
|
+
},
|
60
|
+
"array-type": {
|
61
|
+
"begin": "\\b(Array)(\\[)",
|
62
|
+
"beginCaptures": {
|
63
|
+
"1": {
|
64
|
+
"name": "support.type.array.swift"
|
65
|
+
},
|
66
|
+
"2": {
|
67
|
+
"name": "punctuation.definition.array.begin.swift"
|
68
|
+
}
|
69
|
+
},
|
70
|
+
"end": "(\\])",
|
71
|
+
"endCaptures": {
|
72
|
+
"1": {
|
73
|
+
"name": "punctuation.definition.array.end.swift"
|
74
|
+
}
|
75
|
+
},
|
76
|
+
"name": "meta.array.swift",
|
77
|
+
"patterns": [
|
78
|
+
{
|
79
|
+
"include": "$self"
|
80
|
+
}
|
81
|
+
]
|
82
|
+
},
|
83
|
+
"assignment-operator": {
|
84
|
+
"match": "(?<![/=\\-+!*%<>&|\\^~.])(\\+|\\-|\\*|\\/|%|<<|>>|&|\\^|\\||&&|\\|\\|)?=(?![/=\\-+!*%<>&|\\^~.])",
|
85
|
+
"name": "keyword.operator.assignment.swift"
|
86
|
+
},
|
87
|
+
"attribute": {
|
88
|
+
"comment": "attribute",
|
89
|
+
"name": "meta.attribute.swift",
|
90
|
+
"patterns": [
|
91
|
+
{
|
92
|
+
"begin": "((@)(\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B))(\\()",
|
93
|
+
"beginCaptures": {
|
94
|
+
"1": {
|
95
|
+
"name": "storage.modifier.attribute.swift"
|
96
|
+
},
|
97
|
+
"2": {
|
98
|
+
"name": "punctuation.definition.attribute.swift"
|
99
|
+
},
|
100
|
+
"3": {
|
101
|
+
"name": "punctuation.definition.attribute-arguments.begin.swift"
|
102
|
+
}
|
103
|
+
},
|
104
|
+
"contentName": "meta.attribute.arguments.swift",
|
105
|
+
"end": "\\)",
|
106
|
+
"endCaptures": {
|
107
|
+
"0": {
|
108
|
+
"name": "punctuation.definition.attribute-arguments.end.swift"
|
109
|
+
}
|
110
|
+
},
|
111
|
+
"patterns": [
|
112
|
+
{
|
113
|
+
"include": "$self"
|
114
|
+
}
|
115
|
+
]
|
116
|
+
},
|
117
|
+
{
|
118
|
+
"captures": {
|
119
|
+
"1": {
|
120
|
+
"name": "storage.modifier.attribute.swift"
|
121
|
+
},
|
122
|
+
"2": {
|
123
|
+
"name": "punctuation.definition.attribute.swift"
|
124
|
+
}
|
125
|
+
},
|
126
|
+
"match": "((@)(\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B))"
|
127
|
+
}
|
128
|
+
]
|
129
|
+
},
|
130
|
+
"bitwise-operator": {
|
131
|
+
"match": "(?<![/=\\-+!*%<>&|\\^~.])(&|\\||\\^|<<|>>)(?![/=\\-+!*%<>&|\\^~.])",
|
132
|
+
"name": "keyword.operator.bitwise.swift"
|
133
|
+
},
|
134
|
+
"boolean-literal": {
|
135
|
+
"match": "\\b(true|false)\\b",
|
136
|
+
"name": "constant.language.boolean.swift"
|
137
|
+
},
|
138
|
+
"branch-statement-keyword": {
|
139
|
+
"name": "keyword.control.branch.swift",
|
140
|
+
"patterns": [
|
141
|
+
{
|
142
|
+
"include": "#if-statement-keyword"
|
143
|
+
},
|
144
|
+
{
|
145
|
+
"include": "#switch-statement-keyword"
|
146
|
+
}
|
147
|
+
]
|
148
|
+
},
|
149
|
+
"builtin-class-type": {
|
150
|
+
"comment": "Builtin class types",
|
151
|
+
"match": "\\b(Managed(Buffer|ProtoBuffer)|NonObjectiveCBase|AnyGenerator)\\b",
|
152
|
+
"name": "support.class.swift"
|
153
|
+
},
|
154
|
+
"builtin-constant": {
|
155
|
+
"comment": "Process is really an enum, but it acts like a constant",
|
156
|
+
"match": "\\bProcess\\b",
|
157
|
+
"name": "support.constant.swift"
|
158
|
+
},
|
159
|
+
"builtin-enum-type": {
|
160
|
+
"comment": "Builtin enum types",
|
161
|
+
"match": "\\b(MirrorDisposition|Bit|ImplicitlyUnwrappedOptional|Optional|UnicodeDecodingResult|QuickLookObject|FloatingPointClassification)\\b",
|
162
|
+
"name": "support.type.swift"
|
163
|
+
},
|
164
|
+
"builtin-function": {
|
165
|
+
"comment": "Functions provided in the standard library; found by searching ^[ \\t]+func\\s+(\\w+?)[<(]",
|
166
|
+
"match": "(?<=\\.)(s(tartsWith|ort|u(ccessor|perclassMirror|btract)|amePositionIn)|has(Suffix|Prefix)|next(Object)?|c(haracterAtIndex|o(ntains|untByEnumeratingWithState|pyWithZone)|ustom(Mirror|PlaygroundQuickLook)|lamp)|t(o(IntMax|Opaque|UIntMax)|ake(RetainedValue|UnretainedValue))|i(s(S(trictSu(persetOf|bsetOf)|u(persetOf|bsetOf))|DisjointWith|EmptyInput|ASCII)|n(tersect|itialize(From)?|dex(Of|ForKey)))|object(Enumerator|ForKey|AtIndex)|d(istanceTo|e(s(cendant|troy)|alloc))|un(ion|derestimateCount)|join|p(ut|redecessor)|e(scape|numerate|lementsEqual|xclusiveOr)|keyEnumerator|f(ilter|latMap)|w(ith(CString|U(nsafe(MutablePointer(s|To(Elements|Value))|BufferPointer)|TF8Buffer))|riteTo)|le(ngth|xicographicalCompare)|a(ssign(BackwardFrom|From)|dvancedBy|utorelease)|re(tain|duce|verse|questNativeBuffer|lease)|ge(nerate|t(Mirror|Objects))|m(inElement|ove(Initialize(BackwardFrom|From)|AssignFrom)?|ember|a(p|xElement)))\\b",
|
167
|
+
"name": "support.function.swift"
|
168
|
+
},
|
169
|
+
"builtin-global-function": {
|
170
|
+
"comment": "Global functions provided in the standard library; found by searching ^func\\s+(\\w+?)[<(]",
|
171
|
+
"match": "\\b(s(tride(of(Value)?)?|izeof(Value)?|ort|uffix|pli(ce|t)|wap)|numericCast|transcode|i(sUniquelyReferenced(NonObjC)?|nsert)|zip|overlaps|d(istance|ump|ebugPrint|rop(First|Last))|unsafe(BitCast|Downcast|Unwrap|AddressOf)|join|pr(int|e(condition|fix))|extend|with(Unsafe(MutablePointer(s)?|Pointer(s)?)|ExtendedLifetime|VaList)|lazy|a(ssert(ionFailure)?|nyGenerator|dvance|lignof(Value)?|bs)|re(flect|adLine|move(Range|Last|A(tIndex|ll)))|getVaList|m(in|ax))\\b",
|
172
|
+
"name": "support.function.swift"
|
173
|
+
},
|
174
|
+
"builtin-property": {
|
175
|
+
"comment": "Properties provided in the standard library; found by searching ^\\s+var\\s+(\\w+?)\\W",
|
176
|
+
"match": "(?<=\\.)(s(t(art(Index)?|ringValue)|ummary)|has(hValue|PointerRepresentation)|nulTerminatedUTF8|c(haracters|ount|apacity)|i(s(S(ign(Minus|aling)|ubnormal)|N(ormal|aN)|Infinite|Zero|Empty|Finite|ASCII)|ndices|dentity)|o(wner|bjectIdentifier)|d(isposition|e(scription|bugDescription))|u(nicodeScalar(s)?|tf(16|8(Start)?)|intValue|ppercaseString)|end(Index)?|value(s|Type)?|keys|quickLookObject|f(irst|loatingPointClass)|l(ittleEndian|owercaseString|ast)|a(llocatedElementCount|rray)|rawValue|memory|b(yteS(ize|wapped)|igEndian|oolValue|uffer|aseAddress))\\b",
|
177
|
+
"name": "support.variable.swift"
|
178
|
+
},
|
179
|
+
"builtin-protocol-type": {
|
180
|
+
"comment": "Builtin protocol types",
|
181
|
+
"match": "\\b(Ra(n(domAccessIndexType|geReplaceableCollectionType)|wRepresentable)|GeneratorType|M(irror(Type|PathType)|utable(Sliceable|CollectionType))|B(i(twiseOperationsType|directionalIndexType)|oolean(Type|LiteralConvertible))|S(tr(i(ng(InterpolationConvertible|LiteralConvertible)|deable)|eamable)|i(nkType|gned(NumberType|IntegerType))|e(tAlgebraType|quenceType)|liceable)|Hashable|NilLiteralConvertible|C(o(llectionType|mparable)|ustom(Reflectable|StringConvertible|DebugStringConvertible|PlaygroundQuickLookable|LeafReflectable)|VarArgType)|Inte(rvalType|ger(Type|LiteralConvertible|ArithmeticType))|O(utputStreamType|ptionSetType)|DictionaryLiteralConvertible|Un(signedIntegerType|icode(ScalarLiteralConvertible|CodecType))|E(quatable|rrorType|xten(sibleCollectionType|dedGraphemeClusterLiteralConvertible))|F(orwardIndexType|loat(ingPointType|LiteralConvertible))|A(ny(CollectionType|Object)|rrayLiteralConvertible|bsoluteValuable))\\b",
|
182
|
+
"name": "support.type.swift"
|
183
|
+
},
|
184
|
+
"builtin-static-property": {
|
185
|
+
"comment": "Static properties provided in the standard library; found by searching ^\\s*(class|static)\\s+var\\s+(\\w+?)\\W",
|
186
|
+
"match": "(?<=\\.)(infinity|NaN|quietNaN|allZeros|m(in|ax))\\b|(?<=\\bProcess\\.)(arguments|argc|unsafeArgv)\\b",
|
187
|
+
"name": "support.variable.swift"
|
188
|
+
},
|
189
|
+
"builtin-struct-type": {
|
190
|
+
"comment": "Builtin struct types",
|
191
|
+
"match": "\\b(R(e(peat|verse(RandomAccess(Collection|Index)|Collection|Index))|a(nge(Generator)?|wByte))|Generator(Sequence|OfOne)|M(irror|a(nagedBufferPointer|p(Generator|Sequence|Collection)))|Bool|S(t(aticString|ri(ng|deT(hrough(Generator)?|o(Generator)?)))|inkOf|et(Generator|Index)?)|HalfOpenInterval|C(haracter|o(ntiguousArray|llectionOfOne)|OpaquePointer|losedInterval|VaListPointer)|In(t(16|8|32|64)?|dexingGenerator)|Zip2(Generator|Sequence)|ObjectIdentifier|D(ictionary(Generator|Index|Literal)?|ouble)|U(n(safe(Mutable(BufferPointer|Pointer)|BufferPointer(Generator)?|Pointer)|icodeScalar|managed)|TF(16|8|32)|Int(16|8|32|64)?)|PermutationGenerator|E(numerate(Generator|Sequence)|mpty(Generator|Collection))|F(ilter(Generator|Sequence|Collection(Index)?)|loat(80)?)|Lazy(RandomAccessCollection|BidirectionalCollection|Sequence|ForwardCollection)|A(ny(RandomAccess(Collection|Index)|Bidirectional(Collection|Index)|Sequence|Forward(Collection|Index))|utoreleasingUnsafeMutablePointer|rray(Slice)?))\\b",
|
192
|
+
"name": "support.type.swift"
|
193
|
+
},
|
194
|
+
"builtin-type": {
|
195
|
+
"comment": "Types provided in the standard library; found by searching ^(@objc\\s+)?(struct|protocol|class|enum)\\s+(\\w+)[\\s<].+$",
|
196
|
+
"patterns": [
|
197
|
+
{
|
198
|
+
"include": "#builtin-class-type"
|
199
|
+
},
|
200
|
+
{
|
201
|
+
"include": "#builtin-enum-type"
|
202
|
+
},
|
203
|
+
{
|
204
|
+
"include": "#builtin-protocol-type"
|
205
|
+
},
|
206
|
+
{
|
207
|
+
"include": "#builtin-struct-type"
|
208
|
+
},
|
209
|
+
{
|
210
|
+
"include": "#builtin-typealias"
|
211
|
+
}
|
212
|
+
]
|
213
|
+
},
|
214
|
+
"builtin-typealias": {
|
215
|
+
"comment": "Builtin typealiases",
|
216
|
+
"match": "\\b(BooleanLiteralType|StringLiteralType|C(Bool|S(hort|ignedChar)|Char(16|32)?|Int|Double|Unsigned(Short|Char|Int|Long(Long)?)|Float|WideChar|Long(Long)?)|Int(Max|egerLiteralType)|U(nicodeScalarType|IntMax|Word)|PlaygroundQuickLook|ExtendedGraphemeClusterType|Void|Float(32|LiteralType|64)|Word|Any(Class)?)\\b",
|
217
|
+
"name": "support.type.swift"
|
218
|
+
},
|
219
|
+
"capture-specifier": {
|
220
|
+
"comment": "matches weak, unowned, unowned(safe), unowned(unsafe)",
|
221
|
+
"match": "\\b(weak|unowned(?:\\((?:un)?safe\\))?)",
|
222
|
+
"name": "keyword.other.capture-specifier.swift"
|
223
|
+
},
|
224
|
+
"coalescing-operator": {
|
225
|
+
"match": "(?<![?/=\\-+!*%<>&|\\^~.])\\?\\?(?![?/=\\-+!*%<>&|\\^~.])",
|
226
|
+
"name": "keyword.operator.coalescing.swift"
|
227
|
+
},
|
228
|
+
"code-block": {
|
229
|
+
"begin": "(\\{)",
|
230
|
+
"beginCaptures": {
|
231
|
+
"1": {
|
232
|
+
"name": "punctuation.definition.code-block.begin.swift"
|
233
|
+
}
|
234
|
+
},
|
235
|
+
"comment": "code-block",
|
236
|
+
"end": "(\\})",
|
237
|
+
"endCaptures": {
|
238
|
+
"1": {
|
239
|
+
"name": "punctuation.definition.code-block.end.swift"
|
240
|
+
}
|
241
|
+
},
|
242
|
+
"patterns": [
|
243
|
+
{
|
244
|
+
"include": "$self"
|
245
|
+
}
|
246
|
+
]
|
247
|
+
},
|
248
|
+
"collection-type": {
|
249
|
+
"comment": "Collection types",
|
250
|
+
"patterns": [
|
251
|
+
{
|
252
|
+
"include": "#array-type"
|
253
|
+
},
|
254
|
+
{
|
255
|
+
"include": "#dictionary-type"
|
256
|
+
}
|
257
|
+
]
|
258
|
+
},
|
259
|
+
"comment": {
|
260
|
+
"comment": "All comment types",
|
261
|
+
"patterns": [
|
262
|
+
{
|
263
|
+
"include": "#block-doc"
|
264
|
+
},
|
265
|
+
{
|
266
|
+
"include": "#block"
|
267
|
+
},
|
268
|
+
{
|
269
|
+
"include": "#inline-doc"
|
270
|
+
},
|
271
|
+
{
|
272
|
+
"include": "#inline"
|
273
|
+
}
|
274
|
+
],
|
275
|
+
"repository": {
|
276
|
+
"block": {
|
277
|
+
"begin": "/\\*",
|
278
|
+
"beginCaptures": {
|
279
|
+
"0": {
|
280
|
+
"name": "punctuation.definition.comment.block.begin.swift"
|
281
|
+
}
|
282
|
+
},
|
283
|
+
"end": "\\*/",
|
284
|
+
"endCaptures": {
|
285
|
+
"0": {
|
286
|
+
"name": "punctuation.definition.comment.block.end.swift"
|
287
|
+
}
|
288
|
+
},
|
289
|
+
"name": "comment.block.swift",
|
290
|
+
"patterns": [
|
291
|
+
{
|
292
|
+
"include": "#nested"
|
293
|
+
}
|
294
|
+
],
|
295
|
+
"repository": {
|
296
|
+
"nested": {
|
297
|
+
"begin": "/\\*",
|
298
|
+
"end": "\\*/",
|
299
|
+
"patterns": [
|
300
|
+
{
|
301
|
+
"include": "#block-nested"
|
302
|
+
}
|
303
|
+
]
|
304
|
+
}
|
305
|
+
}
|
306
|
+
},
|
307
|
+
"block-doc": {
|
308
|
+
"begin": "/\\*\\*",
|
309
|
+
"beginCaptures": {
|
310
|
+
"0": {
|
311
|
+
"name": "punctuation.definition.comment.block.documentation.begin.swift"
|
312
|
+
}
|
313
|
+
},
|
314
|
+
"end": "\\*/",
|
315
|
+
"endCaptures": {
|
316
|
+
"0": {
|
317
|
+
"name": "punctuation.definition.comment.block.documentation.end.swift"
|
318
|
+
}
|
319
|
+
},
|
320
|
+
"name": "comment.block.documentation.swift",
|
321
|
+
"patterns": [
|
322
|
+
{
|
323
|
+
"include": "#nested"
|
324
|
+
},
|
325
|
+
{
|
326
|
+
"include": "text.restructuredtext#tags"
|
327
|
+
}
|
328
|
+
],
|
329
|
+
"repository": {
|
330
|
+
"nested": {
|
331
|
+
"begin": "/\\*",
|
332
|
+
"end": "\\*/",
|
333
|
+
"patterns": [
|
334
|
+
{
|
335
|
+
"include": "#block-nested"
|
336
|
+
},
|
337
|
+
{
|
338
|
+
"include": "text.restructuredtext#tags"
|
339
|
+
}
|
340
|
+
]
|
341
|
+
}
|
342
|
+
}
|
343
|
+
},
|
344
|
+
"inline": {
|
345
|
+
"begin": "(^[ \\t]+)?(?=//)",
|
346
|
+
"beginCaptures": {
|
347
|
+
"1": {
|
348
|
+
"name": "punctuation.whitespace.comment.leading.swift"
|
349
|
+
}
|
350
|
+
},
|
351
|
+
"end": "(?!\\G)",
|
352
|
+
"patterns": [
|
353
|
+
{
|
354
|
+
"begin": "//",
|
355
|
+
"beginCaptures": {
|
356
|
+
"0": {
|
357
|
+
"name": "punctuation.definition.comment.swift"
|
358
|
+
}
|
359
|
+
},
|
360
|
+
"end": "\\n",
|
361
|
+
"name": "comment.line.double-slash.swift"
|
362
|
+
}
|
363
|
+
]
|
364
|
+
},
|
365
|
+
"inline-doc": {
|
366
|
+
"begin": "(^[ \\t]+)?(?=///)",
|
367
|
+
"beginCaptures": {
|
368
|
+
"1": {
|
369
|
+
"name": "punctuation.whitespace.comment.leading.swift"
|
370
|
+
}
|
371
|
+
},
|
372
|
+
"end": "(?!\\G)",
|
373
|
+
"patterns": [
|
374
|
+
{
|
375
|
+
"begin": "///",
|
376
|
+
"beginCaptures": {
|
377
|
+
"0": {
|
378
|
+
"name": "punctuation.definition.comment.swift"
|
379
|
+
}
|
380
|
+
},
|
381
|
+
"end": "\\n",
|
382
|
+
"name": "comment.line.triple-slash.swift"
|
383
|
+
}
|
384
|
+
]
|
385
|
+
}
|
386
|
+
}
|
387
|
+
},
|
388
|
+
"comparative-operator": {
|
389
|
+
"match": "(?<![/=\\-+!*%<>&|\\^~.])((=|!)==?|(<|>)=?|~=)(?![/=\\-+!*%<>&|\\^~.])",
|
390
|
+
"name": "keyword.operator.comparative.swift"
|
391
|
+
},
|
392
|
+
"control-transfer-statement-keyword": {
|
393
|
+
"comment": "control-transfer-statement",
|
394
|
+
"match": "\\b(continue|break|fallthrough|return)\\b",
|
395
|
+
"name": "keyword.control.transfer.swift"
|
396
|
+
},
|
397
|
+
"custom-operator": {
|
398
|
+
"patterns": [
|
399
|
+
{
|
400
|
+
"match": "(?<=[\\s(\\[{,;:])([/=\\-+!*%<>&|\\^~.]++)(?![\\s)\\]},;:])",
|
401
|
+
"name": "keyword.operator.custom.prefix.unary.swift"
|
402
|
+
},
|
403
|
+
{
|
404
|
+
"match": "(?<![\\s(\\[{,;:])([/=\\-+!*%<>&|\\^~.]++)(?![\\s)\\]},;:\\.])",
|
405
|
+
"name": "keyword.operator.custom.postfix.unary.swift"
|
406
|
+
},
|
407
|
+
{
|
408
|
+
"match": "(?<=[\\s(\\[{,;:])([/=\\-+!*%<>&|\\^~.]++)(?=[\\s)\\]},;:])",
|
409
|
+
"name": "keyword.operator.custom.binary.swift"
|
410
|
+
}
|
411
|
+
]
|
412
|
+
},
|
413
|
+
"declaration": {
|
414
|
+
"comment": "declaration",
|
415
|
+
"name": "meta.declaration.swift",
|
416
|
+
"patterns": [
|
417
|
+
{
|
418
|
+
"include": "#import-declaration"
|
419
|
+
},
|
420
|
+
{
|
421
|
+
"include": "#function-declaration"
|
422
|
+
}
|
423
|
+
]
|
424
|
+
},
|
425
|
+
"declaration-specifier": {
|
426
|
+
"comment": "declaration-specifier",
|
427
|
+
"match": "\\b(class|deinit|enum|extension|func|import|init|inout|internal|let|operator|private|protocol|public|static|struct|subscript|typealias|var)\\b",
|
428
|
+
"name": "keyword.other.declaration-specifier.swift"
|
429
|
+
},
|
430
|
+
"dictionary-type": {
|
431
|
+
"begin": "\\b(Dictionary)(\\[)",
|
432
|
+
"beginCaptures": {
|
433
|
+
"1": {
|
434
|
+
"name": "support.type.dictionary.swift"
|
435
|
+
},
|
436
|
+
"2": {
|
437
|
+
"name": "punctuation.definition.dictionary.begin.swift"
|
438
|
+
}
|
439
|
+
},
|
440
|
+
"end": "(\\])",
|
441
|
+
"endCaptures": {
|
442
|
+
"1": {
|
443
|
+
"name": "punctuation.definition.dictionary.end.swift"
|
444
|
+
}
|
445
|
+
},
|
446
|
+
"name": "meta.dictionary.swift",
|
447
|
+
"patterns": [
|
448
|
+
{
|
449
|
+
"include": "$self"
|
450
|
+
}
|
451
|
+
]
|
452
|
+
},
|
453
|
+
"floating-point-literal": {
|
454
|
+
"name": "constant.numeric.floating-point.swift",
|
455
|
+
"patterns": [
|
456
|
+
{
|
457
|
+
"comment": "floating-point-literal -> (decimal-literal)(decimal-fraction)?(decimal-exponent)?",
|
458
|
+
"match": "\\b([0-9][0-9_]*)(\\.([0-9][0-9_]*))?([eE][+\\-]?([0-9][0-9_]*))?\\b"
|
459
|
+
},
|
460
|
+
{
|
461
|
+
"comment": "floating-point-literal -> (hexadecimal-literal)(hexadecimal-fraction)?(hexadecimal-exponent)",
|
462
|
+
"match": "\\b(0x\\h[\\h_]*)(\\.(0x\\h[\\h_]*))?([pP][+\\-]?(0x\\h[\\h_]*))\\b"
|
463
|
+
}
|
464
|
+
]
|
465
|
+
},
|
466
|
+
"function-declaration": {
|
467
|
+
"begin": "\\b(func)\\s+(\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B|[/=\\-+!*%<>&|\\^~.]+)\\s*(?=\\(|<)",
|
468
|
+
"beginCaptures": {
|
469
|
+
"1": {
|
470
|
+
"name": "storage.type.function.swift"
|
471
|
+
},
|
472
|
+
"2": {
|
473
|
+
"name": "entity.name.function.swift"
|
474
|
+
}
|
475
|
+
},
|
476
|
+
"comment": "function-declaration",
|
477
|
+
"end": "(?<=\\})|$",
|
478
|
+
"name": "meta.function-declaration.swift",
|
479
|
+
"patterns": [
|
480
|
+
{
|
481
|
+
"include": "#generic-parameter-clause"
|
482
|
+
},
|
483
|
+
{
|
484
|
+
"include": "#parameter-clause"
|
485
|
+
},
|
486
|
+
{
|
487
|
+
"include": "#function-result"
|
488
|
+
},
|
489
|
+
{
|
490
|
+
"begin": "(\\{)",
|
491
|
+
"beginCaptures": {
|
492
|
+
"1": {
|
493
|
+
"name": "punctuation.section.function.begin.swift"
|
494
|
+
}
|
495
|
+
},
|
496
|
+
"end": "(\\})",
|
497
|
+
"endCaptures": {
|
498
|
+
"1": {
|
499
|
+
"name": "punctuation.section.function.end.swift"
|
500
|
+
}
|
501
|
+
},
|
502
|
+
"name": "meta.function-declaration.body.swift",
|
503
|
+
"patterns": [
|
504
|
+
{
|
505
|
+
"include": "$self"
|
506
|
+
}
|
507
|
+
]
|
508
|
+
}
|
509
|
+
]
|
510
|
+
},
|
511
|
+
"function-result": {
|
512
|
+
"begin": "(?<![/=\\-+!*%<>&|\\^~.])(\\->)(?![/=\\-+!*%<>&|\\^~.])\\s*",
|
513
|
+
"beginCaptures": {
|
514
|
+
"1": {
|
515
|
+
"name": "keyword.operator.function-result.swift"
|
516
|
+
}
|
517
|
+
},
|
518
|
+
"comment": "function-result",
|
519
|
+
"end": "(?=\\{)|$",
|
520
|
+
"name": "meta.function-result.swift",
|
521
|
+
"patterns": [
|
522
|
+
{
|
523
|
+
"include": "#type"
|
524
|
+
}
|
525
|
+
]
|
526
|
+
},
|
527
|
+
"generic-parameter-clause": {
|
528
|
+
"begin": "(<)",
|
529
|
+
"beginCaptures": {
|
530
|
+
"1": {
|
531
|
+
"name": "punctuation.definition.generic-parameter-clause.begin.swift"
|
532
|
+
}
|
533
|
+
},
|
534
|
+
"comment": "generic-parameter-clause",
|
535
|
+
"end": "(>)",
|
536
|
+
"endCaptures": {
|
537
|
+
"1": {
|
538
|
+
"name": "punctuation.definition.generic-parameter-clause.end.swift"
|
539
|
+
}
|
540
|
+
},
|
541
|
+
"name": "meta.generic-parameter-clause.swift",
|
542
|
+
"patterns": [
|
543
|
+
{
|
544
|
+
"include": "$self"
|
545
|
+
}
|
546
|
+
]
|
547
|
+
},
|
548
|
+
"identifier": {
|
549
|
+
"comment": "identifier",
|
550
|
+
"match": "(\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B)",
|
551
|
+
"name": "meta.identifier.swift"
|
552
|
+
},
|
553
|
+
"if-statement-keyword": {
|
554
|
+
"comment": "if-statement",
|
555
|
+
"match": "\\b(if|else)\\b",
|
556
|
+
"name": "keyword.control.if.swift"
|
557
|
+
},
|
558
|
+
"import-declaration": {
|
559
|
+
"captures": {
|
560
|
+
"1": {
|
561
|
+
"name": "keyword.other.import.swift"
|
562
|
+
},
|
563
|
+
"2": {
|
564
|
+
"name": "storage.modifier.swift"
|
565
|
+
},
|
566
|
+
"3": {
|
567
|
+
"name": "support.type.module.import.swift"
|
568
|
+
}
|
569
|
+
},
|
570
|
+
"comment": "import-declaration",
|
571
|
+
"match": "\\b(import)\\s+(?:(typealias|struct|class|enum|protocol|var|func)\\s+)?((?:\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B|[/=\\-+!*%<>&|\\^~.]+)(?:\\.(?:\\B\\$[0-9]+|\\b[\\w^\\d][\\w\\d]*\\b|\\B`[\\w^\\d][\\w\\d]*`\\B|[/=\\-+!*%<>&|\\^~.]+))*)",
|
572
|
+
"name": "meta.import.swift"
|
573
|
+
},
|
574
|
+
"increment-decrement-operator": {
|
575
|
+
"match": "(?<![/=\\-+!*%<>&|\\^~.])(\\+\\+|\\-\\-)(?![/=\\-+!*%<>&|\\^~.])",
|
576
|
+
"name": "keyword.operator.increment-or-decrement.swift"
|
577
|
+
},
|
578
|
+
"integer-literal": {
|
579
|
+
"name": "constant.numeric.integer.swift",
|
580
|
+
"patterns": [
|
581
|
+
{
|
582
|
+
"comment": "binary-literal",
|
583
|
+
"match": "(\\B\\-|\\b)(0b[01][01_]*)\\b",
|
584
|
+
"name": "constant.numeric.integer.binary.swift"
|
585
|
+
},
|
586
|
+
{
|
587
|
+
"comment": "octal-literal",
|
588
|
+
"match": "(\\B\\-|\\b)(0o[0-7][0-7_]*)\\b",
|
589
|
+
"name": "constant.numeric.integer.octal.swift"
|
590
|
+
},
|
591
|
+
{
|
592
|
+
"comment": "decimal-literal",
|
593
|
+
"match": "(\\B\\-|\\b)([0-9][0-9_]*)\\b",
|
594
|
+
"name": "constant.numeric.integer.decimal.swift"
|
595
|
+
},
|
596
|
+
{
|
597
|
+
"comment": "hexadecimal-literal",
|
598
|
+
"match": "(\\B\\-|\\b)(0x\\h[\\h_]*)\\b",
|
599
|
+
"name": "constant.numeric.integer.hexadecimal.swift"
|
600
|
+
}
|
601
|
+
]
|
602
|
+
},
|
603
|
+
"keyword": {
|
604
|
+
"patterns": [
|
605
|
+
{
|
606
|
+
"include": "#branch-statement-keyword"
|
607
|
+
},
|
608
|
+
{
|
609
|
+
"include": "#control-transfer-statement-keyword"
|
610
|
+
},
|
611
|
+
{
|
612
|
+
"include": "#loop-statement-keyword"
|
613
|
+
},
|
614
|
+
{
|
615
|
+
"include": "#declaration-specifier"
|
616
|
+
},
|
617
|
+
{
|
618
|
+
"include": "#capture-specifier"
|
619
|
+
},
|
620
|
+
{
|
621
|
+
"include": "#operator-declaration-keyword"
|
622
|
+
},
|
623
|
+
{
|
624
|
+
"comment": "declaration keyword",
|
625
|
+
"match": "\\b(class|deinit|enum|extension|func|import|init|inout|internal|let|operator|private|protocol|public|static|struct|subscript|typealias|var)\\b",
|
626
|
+
"name": "storage.type.declaration.swift"
|
627
|
+
},
|
628
|
+
{
|
629
|
+
"comment": "statement keyword",
|
630
|
+
"match": "\\b(break|case|continue|default|defer|do|else|fallthrough|for|guard|if|in|repeat|return|switch|where|while)\\b",
|
631
|
+
"name": "keyword.control.statement.swift"
|
632
|
+
},
|
633
|
+
{
|
634
|
+
"comment": "expression and type keyword",
|
635
|
+
"match": "\\b(as|catch|dynamicType|false|is|nil|rethrows|super|self|Self|throw|throws|true|try|__COLUMN__|__FILE__|__FUNCTION__|__LINE__)\\b",
|
636
|
+
"name": "keyword.other.statement.swift"
|
637
|
+
},
|
638
|
+
{
|
639
|
+
"comment": "other keyword",
|
640
|
+
"match": "\\b(associativity|convenience|dynamic|didSet|final|get|infix|indirect|lazy|left|mutating|none|nonmutating|optional|override|postfix|precedence|prefix|Protocol|required|right|set|Type|unowned|weak|willSet)\\b",
|
641
|
+
"name": "keyword.other.swift"
|
642
|
+
}
|
643
|
+
]
|
644
|
+
},
|
645
|
+
"literal": {
|
646
|
+
"patterns": [
|
647
|
+
{
|
648
|
+
"include": "#integer-literal"
|
649
|
+
},
|
650
|
+
{
|
651
|
+
"include": "#floating-point-literal"
|
652
|
+
},
|
653
|
+
{
|
654
|
+
"include": "#string-literal"
|
655
|
+
},
|
656
|
+
{
|
657
|
+
"include": "#special-literal"
|
658
|
+
},
|
659
|
+
{
|
660
|
+
"include": "#boolean-literal"
|
661
|
+
},
|
662
|
+
{
|
663
|
+
"include": "#nil-literal"
|
664
|
+
}
|
665
|
+
]
|
666
|
+
},
|
667
|
+
"logical-operator": {
|
668
|
+
"match": "(?<![/=\\-+!*%<>&|\\^~.])(!|&&|\\|\\|)(?![/=\\-+!*%<>&|\\^~.])",
|
669
|
+
"name": "keyword.operator.logical.swift"
|
670
|
+
},
|
671
|
+
"loop-statement-keyword": {
|
672
|
+
"comment": "loop-statement",
|
673
|
+
"match": "\\b(while|do|for|in)\\b",
|
674
|
+
"name": "keyword.control.loop.swift"
|
675
|
+
},
|
676
|
+
"nil-literal": {
|
677
|
+
"match": "\\bnil\\b",
|
678
|
+
"name": "constant.language.nil.swift"
|
679
|
+
},
|
680
|
+
"operator": {
|
681
|
+
"patterns": [
|
682
|
+
{
|
683
|
+
"include": "#comparative-operator"
|
684
|
+
},
|
685
|
+
{
|
686
|
+
"include": "#assignment-operator"
|
687
|
+
},
|
688
|
+
{
|
689
|
+
"include": "#logical-operator"
|
690
|
+
},
|
691
|
+
{
|
692
|
+
"include": "#remainder-operator"
|
693
|
+
},
|
694
|
+
{
|
695
|
+
"include": "#increment-decrement-operator"
|
696
|
+
},
|
697
|
+
{
|
698
|
+
"include": "#overflow-operator"
|
699
|
+
},
|
700
|
+
{
|
701
|
+
"include": "#range-operator"
|
702
|
+
},
|
703
|
+
{
|
704
|
+
"include": "#bitwise-operator"
|
705
|
+
},
|
706
|
+
{
|
707
|
+
"include": "#arithmetic-operator"
|
708
|
+
},
|
709
|
+
{
|
710
|
+
"include": "#ternary-operator"
|
711
|
+
},
|
712
|
+
{
|
713
|
+
"include": "#type-casting-operator"
|
714
|
+
},
|
715
|
+
{
|
716
|
+
"include": "#coalescing-operator"
|
717
|
+
},
|
718
|
+
{
|
719
|
+
"include": "#custom-operator"
|
720
|
+
}
|
721
|
+
]
|
722
|
+
},
|
723
|
+
"operator-declaration-keyword": {
|
724
|
+
"comment": "operator-declaration",
|
725
|
+
"match": "\\b(operator|prefix|infix|postfix)\\b",
|
726
|
+
"name": "keyword.other.operator.swift"
|
727
|
+
},
|
728
|
+
"optional-type": {
|
729
|
+
"beginCaptures": {
|
730
|
+
"1": {
|
731
|
+
"name": "support.type.optional.swift"
|
732
|
+
},
|
733
|
+
"2": {
|
734
|
+
"name": "punctuation.definition.optional.begin.swift"
|
735
|
+
}
|
736
|
+
},
|
737
|
+
"end": "(>)",
|
738
|
+
"endCaptures": {
|
739
|
+
"1": {
|
740
|
+
"name": "punctuation.definition.optional.end.swift"
|
741
|
+
}
|
742
|
+
},
|
743
|
+
"match": "\\b(Optional)(<)",
|
744
|
+
"name": "meta.optional.swift",
|
745
|
+
"patterns": [
|
746
|
+
{
|
747
|
+
"include": "$self"
|
748
|
+
}
|
749
|
+
]
|
750
|
+
},
|
751
|
+
"overflow-operator": {
|
752
|
+
"match": "(?<![/=\\-+!*%<>&|\\^~.])\\&(\\+|\\-|\\*|\\/|%)(?![/=\\-+!*%<>&|\\^~.])",
|
753
|
+
"name": "keyword.operator.overflow.swift"
|
754
|
+
},
|
755
|
+
"parameter-clause": {
|
756
|
+
"begin": "(\\()",
|
757
|
+
"beginCaptures": {
|
758
|
+
"1": {
|
759
|
+
"name": "punctuation.definition.function-arguments.begin.swift"
|
760
|
+
}
|
761
|
+
},
|
762
|
+
"comment": "parameter-clause",
|
763
|
+
"end": "(\\))",
|
764
|
+
"endCaptures": {
|
765
|
+
"1": {
|
766
|
+
"name": "punctuation.definition.function-arguments.end.swift"
|
767
|
+
}
|
768
|
+
},
|
769
|
+
"name": "meta.parameter-clause.swift",
|
770
|
+
"patterns": [
|
771
|
+
{
|
772
|
+
"captures": {
|
773
|
+
"2": {
|
774
|
+
"name": "variable.parameter.function.swift"
|
775
|
+
}
|
776
|
+
},
|
777
|
+
"comment": "named parameters",
|
778
|
+
"match": "\\b([\\w^\\d][\\w\\d]*)\\b\\s+\\b([\\w^\\d][\\w\\d]*)\\b"
|
779
|
+
},
|
780
|
+
{
|
781
|
+
"include": "$self"
|
782
|
+
}
|
783
|
+
]
|
784
|
+
},
|
785
|
+
"protocol-composition-type": {
|
786
|
+
"beginCaptures": {
|
787
|
+
"1": {
|
788
|
+
"name": "support.type.protocol.swift"
|
789
|
+
},
|
790
|
+
"2": {
|
791
|
+
"name": "punctuation.definition.protocol.begin.swift"
|
792
|
+
}
|
793
|
+
},
|
794
|
+
"end": "(>)",
|
795
|
+
"endCaptures": {
|
796
|
+
"1": {
|
797
|
+
"name": "punctuation.definition.protocol.end.swift"
|
798
|
+
}
|
799
|
+
},
|
800
|
+
"match": "\\b(protocol)(<)",
|
801
|
+
"name": "meta.protocol.swift",
|
802
|
+
"patterns": [
|
803
|
+
{
|
804
|
+
"include": "$self"
|
805
|
+
}
|
806
|
+
]
|
807
|
+
},
|
808
|
+
"range-operator": {
|
809
|
+
"match": "(?<![/=\\-+!*%<>&|\\^~.])\\.\\.[.<]?(?![/=\\-+!*%<>&|\\^~.])",
|
810
|
+
"name": "keyword.operator.range.swift"
|
811
|
+
},
|
812
|
+
"remainder-operator": {
|
813
|
+
"match": "(?<![/=\\-+!*%<>&|\\^~.])\\%(?![/=\\-+!*%<>&|\\^~.])",
|
814
|
+
"name": "keyword.operator.remainder.swift"
|
815
|
+
},
|
816
|
+
"section-punctuation": {
|
817
|
+
"patterns": [
|
818
|
+
{
|
819
|
+
"captures": {
|
820
|
+
"1": {
|
821
|
+
"name": "punctuation.section.scope.begin.swift"
|
822
|
+
},
|
823
|
+
"2": {
|
824
|
+
"name": "punctuation.section.scope.end.swift"
|
825
|
+
}
|
826
|
+
},
|
827
|
+
"comment": "Allows the special return snippet to fire.",
|
828
|
+
"match": "(\\{)(\\})"
|
829
|
+
},
|
830
|
+
{
|
831
|
+
"captures": {
|
832
|
+
"1": {
|
833
|
+
"name": "punctuation.section.scope.begin.swift"
|
834
|
+
},
|
835
|
+
"2": {
|
836
|
+
"name": "punctuation.section.scope.end.swift"
|
837
|
+
}
|
838
|
+
},
|
839
|
+
"comment": "Allows the special return snippet to fire.",
|
840
|
+
"match": "(\\()(\\))"
|
841
|
+
},
|
842
|
+
{
|
843
|
+
"captures": {
|
844
|
+
"1": {
|
845
|
+
"name": "punctuation.section.scope.begin.swift"
|
846
|
+
},
|
847
|
+
"2": {
|
848
|
+
"name": "punctuation.section.scope.end.swift"
|
849
|
+
}
|
850
|
+
},
|
851
|
+
"comment": "Allows the special return snippet to fire.",
|
852
|
+
"match": "(\\[)(\\])"
|
853
|
+
}
|
854
|
+
]
|
855
|
+
},
|
856
|
+
"shebang-line": {
|
857
|
+
"captures": {
|
858
|
+
"1": {
|
859
|
+
"name": "punctuation.definition.comment.line.shebang.swift"
|
860
|
+
}
|
861
|
+
},
|
862
|
+
"comment": "Shebang line",
|
863
|
+
"match": "^(#!).*$",
|
864
|
+
"name": "comment.line.shebang.swift"
|
865
|
+
},
|
866
|
+
"special-literal": {
|
867
|
+
"match": "\\b__(FILE|LINE|COLUMN|FUNCTION)__\\b",
|
868
|
+
"name": "keyword.other.literal.swift"
|
869
|
+
},
|
870
|
+
"storage-type": {
|
871
|
+
"match": "\\b(var|func|let|class|enum|struct|protocol|extension|typealias)\\b",
|
872
|
+
"name": "storage.type.swift"
|
873
|
+
},
|
874
|
+
"string-literal": {
|
875
|
+
"begin": "\"",
|
876
|
+
"beginCaptures": {
|
877
|
+
"0": {
|
878
|
+
"name": "punctuation.definition.string.begin.swift"
|
879
|
+
}
|
880
|
+
},
|
881
|
+
"end": "\"",
|
882
|
+
"endCaptures": {
|
883
|
+
"0": {
|
884
|
+
"name": "punctuation.definition.string.end.swift"
|
885
|
+
}
|
886
|
+
},
|
887
|
+
"name": "string.quoted.double.swift",
|
888
|
+
"patterns": [
|
889
|
+
{
|
890
|
+
"match": "\\\\[0\\\\tnr\"']",
|
891
|
+
"name": "constant.character.escape.swift"
|
892
|
+
},
|
893
|
+
{
|
894
|
+
"match": "\\\\u\\{\\h{1,8}\\}",
|
895
|
+
"name": "constant.character.escape.swift"
|
896
|
+
},
|
897
|
+
{
|
898
|
+
"begin": "\\\\\\(",
|
899
|
+
"beginCaptures": {
|
900
|
+
"0": {
|
901
|
+
"name": "punctuation.section.embedded.begin.swift"
|
902
|
+
}
|
903
|
+
},
|
904
|
+
"contentName": "source.swift",
|
905
|
+
"end": "\\)",
|
906
|
+
"endCaptures": {
|
907
|
+
"0": {
|
908
|
+
"name": "punctuation.section.embedded.end.swift"
|
909
|
+
},
|
910
|
+
"1": {
|
911
|
+
"name": "source.swift"
|
912
|
+
}
|
913
|
+
},
|
914
|
+
"name": "meta.embedded.line.swift",
|
915
|
+
"patterns": [
|
916
|
+
{
|
917
|
+
"include": "$self"
|
918
|
+
},
|
919
|
+
{
|
920
|
+
"begin": "\\(",
|
921
|
+
"comment": "Nested parens",
|
922
|
+
"end": "\\)"
|
923
|
+
}
|
924
|
+
]
|
925
|
+
},
|
926
|
+
{
|
927
|
+
"match": "\\\\.",
|
928
|
+
"name": "invalid.illegal.unrecognized-escape.swift"
|
929
|
+
}
|
930
|
+
]
|
931
|
+
},
|
932
|
+
"switch-statement-keyword": {
|
933
|
+
"comment": "switch-statement",
|
934
|
+
"match": "\\b(switch|case|default|where)\\b",
|
935
|
+
"name": "keyword.control.switch.swift"
|
936
|
+
},
|
937
|
+
"ternary-operator": {
|
938
|
+
"match": "(?<=[\\s(\\[{,;:])(\\?|:)(?=[\\s)\\]},;:])",
|
939
|
+
"name": "keyword.operator.ternary.swift"
|
940
|
+
},
|
941
|
+
"type": {
|
942
|
+
"comment": "type",
|
943
|
+
"patterns": [
|
944
|
+
{
|
945
|
+
"include": "#builtin-type"
|
946
|
+
},
|
947
|
+
{
|
948
|
+
"include": "#collection-type"
|
949
|
+
},
|
950
|
+
{
|
951
|
+
"include": "#optional-type"
|
952
|
+
},
|
953
|
+
{
|
954
|
+
"include": "#protocol-composition-type"
|
955
|
+
}
|
956
|
+
]
|
957
|
+
},
|
958
|
+
"type-casting-operator": {
|
959
|
+
"match": "\\b(is\\b|as([!?]\\B|\\b))",
|
960
|
+
"name": "keyword.operator.type-casting.swift"
|
961
|
+
}
|
962
|
+
},
|
963
|
+
"scopeName": "source.swift",
|
964
|
+
"uuid": "D133338A-DEED-4ECC-9852-A392C44D10AC"
|
965
|
+
}
|