github-linguist 9.0.0 → 9.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/bin/github-linguist +3 -3
- data/grammars/etc.json +1 -1
- data/grammars/inline.edgeql.json +1 -1
- data/grammars/liquid.injection.json +1 -1
- data/grammars/source.4dm.json +1 -1
- data/grammars/source.QB64.json +1 -1
- data/grammars/source.abap.json +1 -1
- data/grammars/source.abl.json +1 -1
- data/grammars/source.aiken.json +1 -0
- data/grammars/source.answersetprogramming.json +1 -0
- data/grammars/source.apacheconf.json +1 -0
- data/grammars/source.apex.json +1 -1
- data/grammars/source.assembly.json +1 -1
- data/grammars/source.ats.json +1 -1
- data/grammars/source.ballerina.json +1 -1
- data/grammars/source.brs.json +1 -1
- data/grammars/source.bst.json +1 -0
- data/grammars/source.c++.json +1 -1
- data/grammars/source.c.calendar.json +1 -0
- data/grammars/source.c.json +1 -1
- data/grammars/source.c.linker.json +1 -0
- data/grammars/source.cairo0.json +1 -1
- data/grammars/source.cl.json +1 -1
- data/grammars/source.clue.json +1 -0
- data/grammars/source.cmake.json +1 -1
- data/grammars/source.cmakecache.json +1 -1
- data/grammars/source.cobol.json +1 -1
- data/grammars/source.cs.json +1 -1
- data/grammars/source.curlrc.json +1 -1
- data/grammars/source.curry.json +1 -1
- data/grammars/source.daslang.json +1 -0
- data/grammars/source.dds.dspf.json +1 -1
- data/grammars/source.erlang.json +1 -1
- data/grammars/source.gdscript.json +1 -1
- data/grammars/source.git-revlist.json +1 -1
- data/grammars/source.gleam.json +1 -1
- data/grammars/source.hack.json +1 -1
- data/grammars/source.hcl.json +1 -1
- data/grammars/source.hx.json +1 -1
- data/grammars/source.ice.json +1 -1
- data/grammars/source.ilecobol.json +1 -0
- data/grammars/source.ispc.json +1 -0
- data/grammars/source.jai.json +1 -0
- data/grammars/source.json.comments.json +1 -0
- data/grammars/source.julia.console.json +1 -1
- data/grammars/source.julia.json +1 -1
- data/grammars/source.just.json +1 -1
- data/grammars/source.kdl.json +1 -0
- data/grammars/source.koka.json +1 -0
- data/grammars/source.lean.markdown.json +1 -1
- data/grammars/source.lean4.markdown.json +1 -1
- data/grammars/source.leo.json +1 -0
- data/grammars/source.livescript.json +1 -1
- data/grammars/source.m2.json +1 -1
- data/grammars/source.m3u.json +1 -0
- data/grammars/source.matlab.json +1 -1
- data/grammars/source.mo.json +1 -1
- data/grammars/source.moonbit.json +1 -1
- data/grammars/source.mzn.json +1 -0
- data/grammars/source.nasl.json +1 -1
- data/grammars/source.nim.json +1 -1
- data/grammars/source.nr.json +1 -1
- data/grammars/source.nushell.json +1 -1
- data/grammars/source.objc.json +1 -1
- data/grammars/source.odin.json +1 -1
- data/grammars/source.openesql.json +1 -1
- data/grammars/source.openqasm.json +1 -0
- data/grammars/source.overpassql.json +1 -0
- data/grammars/source.polar.json +1 -1
- data/grammars/source.prisma.json +1 -1
- data/grammars/source.purescript.json +1 -1
- data/grammars/source.ql.json +1 -1
- data/grammars/source.qsharp.json +1 -1
- data/grammars/source.rescript.json +1 -1
- data/grammars/source.roc.json +1 -1
- data/grammars/source.rpgle.json +1 -1
- data/grammars/source.rust.json +1 -1
- data/grammars/source.sail.json +1 -0
- data/grammars/source.scala.json +1 -1
- data/grammars/source.scm.json +1 -0
- data/grammars/source.slang.json +1 -0
- data/grammars/source.slice.json +1 -1
- data/grammars/source.slint.json +1 -1
- data/grammars/source.smithy.json +1 -1
- data/grammars/source.soql.json +1 -1
- data/grammars/source.sourcepawn.json +1 -1
- data/grammars/source.stan.json +1 -1
- data/grammars/source.sway.json +1 -1
- data/grammars/source.swift.json +1 -1
- data/grammars/source.tact.json +1 -1
- data/grammars/source.talon.json +1 -1
- data/grammars/source.templ.json +1 -1
- data/grammars/source.textgrid.json +1 -1
- data/grammars/source.toc.json +1 -1
- data/grammars/source.torrc.json +1 -0
- data/grammars/source.ts.prismaClientRawSQL.json +1 -1
- data/grammars/source.tsp.json +1 -1
- data/grammars/source.typst.json +1 -1
- data/grammars/source.uplc.json +1 -0
- data/grammars/source.vba.json +1 -1
- data/grammars/source.vento.json +1 -0
- data/grammars/source.vue.json +1 -1
- data/grammars/source.wdl.json +1 -1
- data/grammars/source.wit.json +1 -1
- data/grammars/source.xmake.json +1 -0
- data/grammars/source.zmodel.json +1 -0
- data/grammars/text.adblock.json +1 -1
- data/grammars/text.html.liquid.json +1 -1
- data/grammars/text.html.markdown.d2.json +1 -1
- data/grammars/text.html.vento.json +1 -0
- data/grammars/text.rtf.json +1 -1
- data/grammars/text.valve-cfg.json +1 -1
- data/grammars/version +1 -1
- data/lib/linguist/VERSION +1 -1
- data/lib/linguist/generated.rb +24 -2
- data/lib/linguist/heuristics.yml +65 -18
- data/lib/linguist/languages.json +1 -1
- data/lib/linguist/languages.yml +298 -33
- data/lib/linguist/samples.json +1 -1
- data/lib/linguist/shebang.rb +1 -1
- metadata +34 -14
- data/grammars/source.apache-config.json +0 -1
- data/grammars/source.apache-config.mod_perl.json +0 -1
- data/grammars/source.c.platform.json +0 -1
- data/grammars/text.html.erlang.yaws.json +0 -1
data/grammars/source.sway.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"name":"Sway","scopeName":"source.sway","patterns":[{"begin":"(\u003c)(\\[)","end":"\u003e","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#gtypes"},{"include":"#lvariables"},{"include":"#lifetimes"},{"include":"#punctuation"},{"include":"#types"}],"beginCaptures":{"1":{"name":"punctuation.brackets.angle.sway"},"2":{"name":"punctuation.brackets.square.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.angle.sway"}}},{"name":"meta.attribute.sway","begin":"(#)(\\!?)(\\[)","end":"\\]","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lifetimes"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#gtypes"},{"include":"#types"}],"beginCaptures":{"1":{"name":"punctuation.definition.attribute.sway"},"2":{"name":"keyword.operator.attribute.inner.sway"},"3":{"name":"punctuation.brackets.attribute.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.attribute.sway"}}},{"match":"(dep)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][A-Za-z0-9_]*)","captures":{"1":{"name":"storage.type.sway"},"2":{"name":"entity.name.dependency.sway"}}},{"name":"meta.import.sway","begin":"\\b(extern)\\s+(crate)","end":";","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#punctuation"}],"beginCaptures":{"1":{"name":"storage.type.sway"},"2":{"name":"keyword.other.crate.sway"}},"endCaptures":{"0":{"name":"punctuation.semi.sway"}}},{"name":"meta.use.sway","begin":"\\b(use)\\s","end":";","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#types"},{"include":"#lvariables"}],"beginCaptures":{"1":{"name":"keyword.other.sway"}},"endCaptures":{"0":{"name":"punctuation.semi.sway"}}},{"include":"#block-comments"},{"include":"#comments"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#types"},{"include":"#keywords"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#variables"}],"repository":{"block-comments":{"patterns":[{"name":"comment.block.sway","match":"/\\*\\*/"},{"name":"comment.block.documentation.sway","begin":"/\\*\\*","end":"\\*/","patterns":[{"include":"#block-comments"}]},{"name":"comment.block.sway","begin":"/\\*(?!\\*)","end":"\\*/","patterns":[{"include":"#block-comments"}]}]},"comments":{"patterns":[{"name":"comment.line.documentation.sway","match":"^\\s*///.*"},{"name":"comment.line.double-slash.sway","match":"\\s*//.*"}]},"constants":{"patterns":[{"name":"constant.other.caps.sway","match":"\\b[A-Z]{2}[A-Z0-9_]*\\b"},{"match":"\\b(const)\\s+([A-Z][A-Za-z0-9_]*)\\b","captures":{"1":{"name":"storage.type.sway"},"2":{"name":"constant.other.caps.sway"}}},{"name":"constant.numeric.decimal.sway","match":"\\b\\d[\\d_]*(\\.?)[\\d_]*(?:(E)([+-])([\\d_]+))?(f32|f64|i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b","captures":{"1":{"name":"punctuation.separator.dot.decimal.sway"},"2":{"name":"keyword.operator.exponent.sway"},"3":{"name":"keyword.operator.exponent.sign.sway"},"4":{"name":"constant.numeric.decimal.exponent.mantissa.sway"},"5":{"name":"entity.name.type.numeric.sway"}}},{"name":"constant.numeric.hex.sway","match":"\\b0x[\\da-fA-F_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b","captures":{"1":{"name":"entity.name.type.numeric.sway"}}},{"name":"constant.numeric.oct.sway","match":"\\b0o[0-7_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b","captures":{"1":{"name":"entity.name.type.numeric.sway"}}},{"name":"constant.numeric.bin.sway","match":"\\b0b[01_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b","captures":{"1":{"name":"entity.name.type.numeric.sway"}}},{"name":"constant.language.bool.sway","match":"\\b(true|false)\\b"}]},"escapes":{"name":"constant.character.escape.sway","match":"(\\\\)(?:(?:(x[0-7][0-7a-fA-F])|(u(\\{)[\\da-fA-F]{4,6}(\\}))|.))","captures":{"1":{"name":"constant.character.escape.backslash.sway"},"2":{"name":"constant.character.escape.bit.sway"},"3":{"name":"constant.character.escape.unicode.sway"},"4":{"name":"constant.character.escape.unicode.punctuation.sway"},"5":{"name":"constant.character.escape.unicode.punctuation.sway"}}},"functions":{"patterns":[{"match":"\\b(pub)(\\()","captures":{"1":{"name":"keyword.other.sway"},"2":{"name":"punctuation.brackets.round.sway"}}},{"name":"meta.asm.definition.sway","begin":"\\b(asm)((\\())","end":"\\{|;","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"meta.attribute.asm.sway"},"2":{"name":"punctuation.brackets.round.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.curly.sway"}}},{"name":"meta.function.definition.sway","begin":"\\b(fn)\\s+((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)((\\()|(\u003c))","end":"\\{|;","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"keyword.other.fn.sway"},"2":{"name":"entity.name.function.sway"},"4":{"name":"punctuation.brackets.round.sway"},"5":{"name":"punctuation.brackets.angle.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.curly.sway"}}},{"name":"meta.function.call.sway","begin":"((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(\\()","end":"\\)","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"entity.name.function.sway"},"2":{"name":"punctuation.brackets.round.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.round.sway"}}},{"name":"meta.function.call.sway","begin":"((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(?=::\u003c.*\u003e\\()","end":"\\)","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"entity.name.function.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.round.sway"}}}]},"gtypes":{"patterns":[{"name":"entity.name.type.option.sway","match":"\\b(Some|None)\\b"},{"name":"entity.name.type.result.sway","match":"\\b(Ok|Err)\\b"}]},"interpolations":{"name":"meta.interpolation.sway","match":"({)[^\"{}]*(})","captures":{"1":{"name":"punctuation.definition.interpolation.sway"},"2":{"name":"punctuation.definition.interpolation.sway"}}},"keywords":{"patterns":[{"name":"keyword.control.sway","match":"\\b(await|break|continue|do|else|for|if|loop|match|return|try|while|yield)\\b"},{"name":"keyword.other.sway storage.type.sway","match":"\\b(extern|macro|dep)\\b"},{"name":"storage.modifier.sway","match":"\\b(const)\\b"},{"name":"storage.modifier.sway","match":"\\b(let)\\b"},{"name":"keyword.declaration.type.sway storage.type.sway","match":"\\b(type)\\b"},{"name":"keyword.declaration.enum.sway storage.type.sway","match":"\\b(enum)\\b"},{"name":"keyword.declaration.trait.sway storage.type.sway","match":"\\b(trait)\\b"},{"name":"keyword.declaration.abi.sway storage.type.sway","match":"\\b(abi)\\b"},{"name":"keyword.declaration.struct.sway","match":"\\b(struct)\\b"},{"name":"storage.modifier.sway","match":"\\b(abstract|static)\\b"},{"name":"keyword.other.sway","match":"\\b(as|async|become|box|dyn|move|final|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual|where)\\b"},{"name":"keyword.other.fn.sway","match":"\\bfn\\b"},{"name":"meta.attribute.asm.sway","match":"\\basm\\b"},{"name":"keyword.other.crate.sway","match":"\\bcrate\\b"},{"name":"storage.modifier.mut.sway","match":"\\bmut\\b"},{"name":"keyword.operator.logical.sway","match":"(\\^|\\||\\|\\||\u0026\u0026|\u003c\u003c|\u003e\u003e|!)(?!=)"},{"name":"keyword.operator.borrow.and.sway","match":"\u0026(?![\u0026=])"},{"name":"keyword.operator.assignment.sway","match":"(\\+=|-=|\\*=|/=|%=|\\^=|\u0026=|\\|=|\u003c\u003c=|\u003e\u003e=)"},{"name":"keyword.operator.assignment.equal.sway","match":"(?\u003c![\u003c\u003e])=(?!=|\u003e)"},{"name":"keyword.operator.comparison.sway","match":"(=(=)?(?!\u003e)|!=|\u003c=|(?\u003c!=)\u003e=)"},{"name":"keyword.operator.math.sway","match":"(([+%]|(\\*(?!\\w)))(?!=))|(-(?!\u003e))|(/(?!/))"},{"match":"(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([\u003c\u003e])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))","captures":{"1":{"name":"punctuation.brackets.round.sway"},"2":{"name":"punctuation.brackets.square.sway"},"3":{"name":"punctuation.brackets.curly.sway"},"4":{"name":"keyword.operator.comparison.sway"},"5":{"name":"punctuation.brackets.round.sway"},"6":{"name":"punctuation.brackets.square.sway"},"7":{"name":"punctuation.brackets.curly.sway"}}},{"name":"keyword.operator.namespace.sway","match":"::"},{"match":"(\\*)(?=\\w+)","captures":{"1":{"name":"keyword.operator.dereference.sway"}}},{"name":"keyword.operator.subpattern.sway","match":"@"},{"name":"keyword.operator.access.dot.sway","match":"\\.(?!\\.)"},{"name":"keyword.operator.range.sway","match":"\\.{2}(=|\\.)?"},{"name":"keyword.operator.key-value.sway","match":":(?!:)"},{"name":"keyword.operator.arrow.skinny.sway","match":"-\u003e"},{"name":"keyword.operator.arrow.fat.sway","match":"=\u003e"},{"name":"keyword.operator.macro.dollar.sway","match":"\\$"},{"name":"keyword.operator.question.sway","match":"\\?"}]},"lifetimes":{"patterns":[{"match":"(['])([a-zA-Z_][0-9a-zA-Z_]*)(?!['])\\b","captures":{"1":{"name":"punctuation.definition.lifetime.sway"},"2":{"name":"entity.name.type.lifetime.sway"}}},{"match":"(\\\u0026)(['])([a-zA-Z_][0-9a-zA-Z_]*)(?!['])\\b","captures":{"1":{"name":"keyword.operator.borrow.sway"},"2":{"name":"punctuation.definition.lifetime.sway"},"3":{"name":"entity.name.type.lifetime.sway"}}}]},"lvariables":{"patterns":[{"name":"variable.language.self.sway","match":"\\b[Ss]elf\\b"},{"name":"variable.language.super.sway","match":"\\bsuper\\b"}]},"macros":{"patterns":[{"name":"meta.macro.sway","match":"(([a-z_][A-Za-z0-9_]*!)|([A-Z_][A-Za-z0-9_]*!))","captures":{"2":{"name":"entity.name.function.macro.sway"},"3":{"name":"entity.name.type.macro.sway"}}}]},"namespaces":{"patterns":[{"match":"(?\u003c![A-Za-z0-9_])([a-z0-9_]+)((?\u003c!super|self)::)","captures":{"1":{"name":"entity.name.namespace.sway"},"2":{"name":"keyword.operator.namespace.sway"}}}]},"punctuation":{"patterns":[{"name":"punctuation.comma.sway","match":","},{"name":"punctuation.brackets.curly.sway","match":"[{}]"},{"name":"punctuation.brackets.round.sway","match":"[()]"},{"name":"punctuation.semi.sway","match":";"},{"name":"punctuation.brackets.square.sway","match":"[\\[\\]]"},{"name":"punctuation.brackets.angle.sway","match":"(?\u003c!=)[\u003c\u003e]"}]},"strings":{"patterns":[{"name":"string.quoted.double.sway","begin":"(b?)(\")","end":"\"","patterns":[{"include":"#escapes"},{"include":"#interpolations"}],"beginCaptures":{"1":{"name":"string.quoted.byte.raw.sway"},"2":{"name":"punctuation.definition.string.sway"}},"endCaptures":{"0":{"name":"punctuation.definition.string.sway"}}},{"name":"string.quoted.double.sway","begin":"(b?r)(#*)(\")","end":"(\")(\\2)","beginCaptures":{"1":{"name":"string.quoted.byte.raw.sway"},"2":{"name":"punctuation.definition.string.raw.sway"},"3":{"name":"punctuation.definition.string.sway"}},"endCaptures":{"1":{"name":"punctuation.definition.string.sway"},"2":{"name":"punctuation.definition.string.raw.sway"}}},{"name":"string.quoted.single.char.sway","begin":"(b)?(')","end":"'","patterns":[{"include":"#escapes"}],"beginCaptures":{"1":{"name":"string.quoted.byte.raw.sway"},"2":{"name":"punctuation.definition.char.sway"}},"endCaptures":{"0":{"name":"punctuation.definition.char.sway"}}}]},"types":{"patterns":[{"match":"(?\u003c![A-Za-z])(f32|f64|i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)\\b","captures":{"1":{"name":"entity.name.type.numeric.sway"}}},{"begin":"\\b([A-Z][A-Za-z0-9]*)(\u003c)","end":"\u003e","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#lifetimes"},{"include":"#punctuation"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"entity.name.type.sway"},"2":{"name":"punctuation.brackets.angle.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.angle.sway"}}},{"name":"entity.name.type.primitive.sway","match":"\\b(bool|char|str)\\b"},{"match":"\\b(trait)\\s+([A-Z][A-Za-z0-9]*)\\b","captures":{"1":{"name":"keyword.declaration.trait.sway storage.type.sway"},"2":{"name":"entity.name.type.trait.sway"}}},{"match":"\\b(abi)\\s+([A-Z][A-Za-z0-9]*)\\b","captures":{"1":{"name":"keyword.declaration.abi.sway storage.type.sway"},"2":{"name":"entity.name.type.abi.sway"}}},{"match":"\\b(struct)\\s+([A-Z][A-Za-z0-9]*)\\b","captures":{"1":{"name":"keyword.declaration.struct.sway"},"2":{"name":"entity.name.type.struct.sway"}}},{"match":"\\b(enum)\\s+([A-Z][A-Za-z0-9_]*)\\b","captures":{"1":{"name":"keyword.declaration.enum.sway"},"2":{"name":"entity.name.type.enum.sway"}}},{"match":"\\b(type)\\s+([A-Z][A-Za-z0-9_]*)\\b","captures":{"1":{"name":"keyword.declaration.type.sway storage.type.sway"},"2":{"name":"entity.name.type.declaration.sway"}}},{"name":"entity.name.type.sway","match":"\\b[A-Z][A-Za-z0-9]*\\b(?!!)"},{"begin":"\\b(library)\\s+([a-zA-Z_][a-zA-Z0-9_]*)","end":"[\\{\\(;]","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#types"},{"include":"#lvariables"}],"beginCaptures":{"1":{"name":"source.sway meta.attribute.sway"},"2":{"name":"entity.name.type.sway"}}},{"match":"(contract|script|predicate);","captures":{"1":{"name":"source.sway meta.attribute.sway"}}}]},"variables":{"patterns":[{"name":"variable.other.sway","match":"\\b(?\u003c!(?\u003c!\\.)\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b"}]}}}
|
1
|
+
{"name":"Sway","scopeName":"source.sway","patterns":[{"begin":"(\u003c)(\\[)","end":"\u003e","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#gtypes"},{"include":"#lvariables"},{"include":"#lifetimes"},{"include":"#punctuation"},{"include":"#types"}],"beginCaptures":{"1":{"name":"punctuation.brackets.angle.sway"},"2":{"name":"punctuation.brackets.square.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.angle.sway"}}},{"name":"meta.attribute.sway","begin":"(#)(\\!?)(\\[)","end":"\\]","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lifetimes"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#gtypes"},{"include":"#types"}],"beginCaptures":{"1":{"name":"punctuation.definition.attribute.sway"},"2":{"name":"keyword.operator.attribute.inner.sway"},"3":{"name":"punctuation.brackets.attribute.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.attribute.sway"}}},{"match":"(dep)\\s+((?:r#(?!crate|[Ss]elf|super))?[a-z][A-Za-z0-9_]*)","captures":{"1":{"name":"storage.type.sway"},"2":{"name":"entity.name.dependency.sway"}}},{"name":"meta.import.sway","begin":"\\b(extern)\\s+(crate)","end":";","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#punctuation"}],"beginCaptures":{"1":{"name":"storage.type.sway"},"2":{"name":"keyword.other.crate.sway"}},"endCaptures":{"0":{"name":"punctuation.semi.sway"}}},{"name":"meta.use.sway","begin":"\\b(use)\\s","end":";","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#types"},{"include":"#lvariables"}],"beginCaptures":{"1":{"name":"keyword.other.sway"}},"endCaptures":{"0":{"name":"punctuation.semi.sway"}}},{"include":"#block-comments"},{"include":"#comments"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#types"},{"include":"#keywords"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#variables"}],"repository":{"block-comments":{"patterns":[{"name":"comment.block.sway","match":"/\\*\\*/"},{"name":"comment.block.documentation.sway","begin":"/\\*\\*","end":"\\*/","patterns":[{"include":"#block-comments"}]},{"name":"comment.block.sway","begin":"/\\*(?!\\*)","end":"\\*/","patterns":[{"include":"#block-comments"}]}]},"comments":{"patterns":[{"name":"comment.line.documentation.sway","match":"^\\s*///.*"},{"name":"comment.line.double-slash.sway","match":"\\s*//.*"}]},"constants":{"patterns":[{"name":"constant.other.caps.sway","match":"\\b[A-Z]{2}[A-Z0-9_]*\\b"},{"match":"\\b(const)\\s+([A-Z][A-Za-z0-9_]*)\\b","captures":{"1":{"name":"storage.type.sway"},"2":{"name":"constant.other.caps.sway"}}},{"name":"constant.numeric.decimal.sway","match":"\\b\\d[\\d_]*(\\.?)[\\d_]*(?:(E)([+-])([\\d_]+))?(f32|f64|i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b","captures":{"1":{"name":"punctuation.separator.dot.decimal.sway"},"2":{"name":"keyword.operator.exponent.sway"},"3":{"name":"keyword.operator.exponent.sign.sway"},"4":{"name":"constant.numeric.decimal.exponent.mantissa.sway"},"5":{"name":"entity.name.type.numeric.sway"}}},{"name":"constant.numeric.hex.sway","match":"\\b0x[\\da-fA-F_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b","captures":{"1":{"name":"entity.name.type.numeric.sway"}}},{"name":"constant.numeric.oct.sway","match":"\\b0o[0-7_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b","captures":{"1":{"name":"entity.name.type.numeric.sway"}}},{"name":"constant.numeric.bin.sway","match":"\\b0b[01_]+(i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)?\\b","captures":{"1":{"name":"entity.name.type.numeric.sway"}}},{"name":"constant.language.bool.sway","match":"\\b(true|false)\\b"}]},"escapes":{"name":"constant.character.escape.sway","match":"(\\\\)(?:(?:(x[0-7][0-7a-fA-F])|(u(\\{)[\\da-fA-F]{4,6}(\\}))|.))","captures":{"1":{"name":"constant.character.escape.backslash.sway"},"2":{"name":"constant.character.escape.bit.sway"},"3":{"name":"constant.character.escape.unicode.sway"},"4":{"name":"constant.character.escape.unicode.punctuation.sway"},"5":{"name":"constant.character.escape.unicode.punctuation.sway"}}},"functions":{"patterns":[{"match":"\\b(pub)(\\()","captures":{"1":{"name":"keyword.other.sway"},"2":{"name":"punctuation.brackets.round.sway"}}},{"name":"meta.asm.definition.sway","begin":"\\b(asm)((\\())","end":"\\{|;","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"meta.attribute.asm.sway"},"2":{"name":"punctuation.brackets.round.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.curly.sway"}}},{"name":"meta.function.definition.sway","begin":"\\b(fn)\\s+((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)((\\()|(\u003c))","end":"\\{|;","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"keyword.other.fn.sway"},"2":{"name":"entity.name.function.sway"},"4":{"name":"punctuation.brackets.round.sway"},"5":{"name":"punctuation.brackets.angle.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.curly.sway"}}},{"name":"meta.function.call.sway","begin":"((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(\\()","end":"\\)","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"entity.name.function.sway"},"2":{"name":"punctuation.brackets.round.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.round.sway"}}},{"name":"meta.function.call.sway","begin":"((?:r#(?!crate|[Ss]elf|super))?[A-Za-z0-9_]+)(?=::\u003c.*\u003e\\()","end":"\\)","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#constants"},{"include":"#gtypes"},{"include":"#functions"},{"include":"#lifetimes"},{"include":"#macros"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#strings"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"entity.name.function.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.round.sway"}}}]},"gtypes":{"patterns":[{"name":"entity.name.type.option.sway","match":"\\b(Some|None)\\b"},{"name":"entity.name.type.result.sway","match":"\\b(Ok|Err)\\b"}]},"interpolations":{"name":"meta.interpolation.sway","match":"({)[^\"{}]*(})","captures":{"1":{"name":"punctuation.definition.interpolation.sway"},"2":{"name":"punctuation.definition.interpolation.sway"}}},"keywords":{"patterns":[{"name":"keyword.control.sway","match":"\\b(await|break|continue|do|else|for|if|loop|match|return|try|while|yield)\\b"},{"name":"keyword.other.sway storage.type.sway","match":"\\b(extern|macro|dep)\\b"},{"name":"storage.modifier.sway","match":"\\b(const)\\b"},{"name":"storage.modifier.sway","match":"\\b(let)\\b"},{"name":"keyword.declaration.type.sway","match":"\\b(type)\\b"},{"name":"keyword.declaration.enum.sway","match":"\\b(enum)\\b"},{"name":"keyword.declaration.trait.sway","match":"\\b(trait)\\b"},{"name":"keyword.declaration.abi.sway","match":"\\b(abi)\\b"},{"name":"keyword.declaration.struct.sway","match":"\\b(struct)\\b"},{"name":"storage.modifier.sway","match":"\\b(abstract|static)\\b"},{"name":"keyword.other.sway","match":"\\b(as|async|become|box|dyn|move|final|impl|in|override|priv|pub|ref|typeof|union|unsafe|unsized|use|virtual|where)\\b"},{"name":"keyword.other.fn.sway","match":"\\bfn\\b"},{"name":"keyword.other.asm.sway","match":"\\basm\\b"},{"name":"keyword.other.crate.sway","match":"\\bcrate\\b"},{"name":"storage.modifier.mut.sway","match":"\\bmut\\b"},{"name":"keyword.operator.logical.sway","match":"(\\^|\\||\\|\\||\u0026\u0026|\u003c\u003c|\u003e\u003e|!)(?!=)"},{"name":"keyword.operator.borrow.and.sway","match":"\u0026(?![\u0026=])"},{"name":"keyword.operator.assignment.sway","match":"(\\+=|-=|\\*=|/=|%=|\\^=|\u0026=|\\|=|\u003c\u003c=|\u003e\u003e=)"},{"name":"keyword.operator.assignment.equal.sway","match":"(?\u003c![\u003c\u003e])=(?!=|\u003e)"},{"name":"keyword.operator.comparison.sway","match":"(=(=)?(?!\u003e)|!=|\u003c=|(?\u003c!=)\u003e=)"},{"name":"keyword.operator.math.sway","match":"(([+%]|(\\*(?!\\w)))(?!=))|(-(?!\u003e))|(/(?!/))"},{"match":"(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([\u003c\u003e])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))","captures":{"1":{"name":"punctuation.brackets.round.sway"},"2":{"name":"punctuation.brackets.square.sway"},"3":{"name":"punctuation.brackets.curly.sway"},"4":{"name":"keyword.operator.comparison.sway"},"5":{"name":"punctuation.brackets.round.sway"},"6":{"name":"punctuation.brackets.square.sway"},"7":{"name":"punctuation.brackets.curly.sway"}}},{"name":"keyword.operator.namespace.sway","match":"::"},{"match":"(\\*)(?=\\w+)","captures":{"1":{"name":"keyword.operator.dereference.sway"}}},{"name":"keyword.operator.subpattern.sway","match":"@"},{"name":"keyword.operator.access.dot.sway","match":"\\.(?!\\.)"},{"name":"keyword.operator.range.sway","match":"\\.{2}(=|\\.)?"},{"name":"keyword.operator.key-value.sway","match":":(?!:)"},{"name":"keyword.operator.arrow.skinny.sway","match":"-\u003e"},{"name":"keyword.operator.arrow.fat.sway","match":"=\u003e"},{"name":"keyword.operator.macro.dollar.sway","match":"\\$"},{"name":"keyword.operator.question.sway","match":"\\?"}]},"lifetimes":{"patterns":[{"match":"(['])([a-zA-Z_][0-9a-zA-Z_]*)(?!['])\\b","captures":{"1":{"name":"punctuation.definition.lifetime.sway"},"2":{"name":"entity.name.type.lifetime.sway"}}},{"match":"(\\\u0026)(['])([a-zA-Z_][0-9a-zA-Z_]*)(?!['])\\b","captures":{"1":{"name":"keyword.operator.borrow.sway"},"2":{"name":"punctuation.definition.lifetime.sway"},"3":{"name":"entity.name.type.lifetime.sway"}}}]},"lvariables":{"patterns":[{"name":"variable.language.self.sway","match":"\\b[Ss]elf\\b"},{"name":"variable.language.super.sway","match":"\\bsuper\\b"}]},"macros":{"patterns":[{"name":"meta.macro.sway","match":"(([a-z_][A-Za-z0-9_]*!)|([A-Z_][A-Za-z0-9_]*!))","captures":{"2":{"name":"entity.name.function.macro.sway"},"3":{"name":"entity.name.type.macro.sway"}}}]},"namespaces":{"patterns":[{"match":"(?\u003c![A-Za-z0-9_])([a-z0-9_]+)((?\u003c!super|self)::)","captures":{"1":{"name":"entity.name.namespace.sway"},"2":{"name":"keyword.operator.namespace.sway"}}}]},"punctuation":{"patterns":[{"name":"punctuation.comma.sway","match":","},{"name":"punctuation.brackets.curly.sway","match":"[{}]"},{"name":"punctuation.brackets.round.sway","match":"[()]"},{"name":"punctuation.semi.sway","match":";"},{"name":"punctuation.brackets.square.sway","match":"[\\[\\]]"},{"name":"punctuation.brackets.angle.sway","match":"(?\u003c!=)[\u003c\u003e]"}]},"strings":{"patterns":[{"name":"string.quoted.double.sway","begin":"(b?)(\")","end":"\"","patterns":[{"include":"#escapes"},{"include":"#interpolations"}],"beginCaptures":{"1":{"name":"string.quoted.byte.raw.sway"},"2":{"name":"punctuation.definition.string.sway"}},"endCaptures":{"0":{"name":"punctuation.definition.string.sway"}}},{"name":"string.quoted.double.sway","begin":"(b?r)(#*)(\")","end":"(\")(\\2)","beginCaptures":{"1":{"name":"string.quoted.byte.raw.sway"},"2":{"name":"punctuation.definition.string.raw.sway"},"3":{"name":"punctuation.definition.string.sway"}},"endCaptures":{"1":{"name":"punctuation.definition.string.sway"},"2":{"name":"punctuation.definition.string.raw.sway"}}},{"name":"string.quoted.single.char.sway","begin":"(b)?(')","end":"'","patterns":[{"include":"#escapes"}],"beginCaptures":{"1":{"name":"string.quoted.byte.raw.sway"},"2":{"name":"punctuation.definition.char.sway"}},"endCaptures":{"0":{"name":"punctuation.definition.char.sway"}}}]},"types":{"patterns":[{"match":"(?\u003c![A-Za-z])(f32|f64|i128|i16|i32|i64|i8|isize|u128|u16|u32|u64|u8|usize)\\b","captures":{"1":{"name":"entity.name.type.numeric.sway"}}},{"begin":"\\b([A-Z][A-Za-z0-9]*)(\u003c)","end":"\u003e","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#lvariables"},{"include":"#lifetimes"},{"include":"#punctuation"},{"include":"#types"},{"include":"#variables"}],"beginCaptures":{"1":{"name":"entity.name.type.sway"},"2":{"name":"punctuation.brackets.angle.sway"}},"endCaptures":{"0":{"name":"punctuation.brackets.angle.sway"}}},{"name":"entity.name.type.primitive.sway","match":"\\b(bool|char|str)\\b"},{"match":"\\b(trait)\\s+([A-Z][A-Za-z0-9]*)\\b","captures":{"1":{"name":"keyword.declaration.trait.sway"},"2":{"name":"entity.name.type.trait.sway"}}},{"match":"\\b(abi)\\s+([A-Z][A-Za-z0-9]*)\\b","captures":{"1":{"name":"keyword.declaration.abi.sway"},"2":{"name":"entity.name.type.abi.sway"}}},{"match":"\\b(struct)\\s+([A-Z][A-Za-z0-9]*)\\b","captures":{"1":{"name":"keyword.declaration.struct.sway"},"2":{"name":"entity.name.type.struct.sway"}}},{"match":"\\b(enum)\\s+([A-Z][A-Za-z0-9_]*)\\b","captures":{"1":{"name":"keyword.declaration.enum.sway"},"2":{"name":"entity.name.type.enum.sway"}}},{"match":"\\b(type)\\s+([A-Z][A-Za-z0-9_]*)\\b","captures":{"1":{"name":"keyword.declaration.type.sway"},"2":{"name":"entity.name.type.declaration.sway"}}},{"name":"entity.name.type.sway","match":"\\b[A-Z][A-Za-z0-9]*\\b(?!!)"},{"begin":"\\b(library)\\s+([a-zA-Z_][a-zA-Z0-9_]*)","end":"[\\{\\(;]","patterns":[{"include":"#block-comments"},{"include":"#comments"},{"include":"#keywords"},{"include":"#namespaces"},{"include":"#punctuation"},{"include":"#types"},{"include":"#lvariables"}],"beginCaptures":{"1":{"name":"source.sway meta.attribute.sway"},"2":{"name":"entity.name.type.sway"}}},{"match":"(contract|script|predicate);","captures":{"1":{"name":"source.sway meta.attribute.sway"}}}]},"variables":{"patterns":[{"name":"variable.other.sway","match":"\\b(?\u003c!(?\u003c!\\.)\\.)(?:r#(?!(crate|[Ss]elf|super)))?[a-z0-9_]+\\b"}]}}}
|