grammars/source.clar.json in github-linguist-7.30.0 vs grammars/source.clar.json in github-linguist-8.0.0

- old
+ new

@@ -1 +1 @@ -{"name":"clarity","scopeName":"source.clar","patterns":[{"include":"#expression"},{"include":"#define-constant"},{"include":"#define-data-var"},{"include":"#define-map"},{"include":"#define-function"},{"include":"#define-fungible-token"},{"include":"#define-non-fungible-token"},{"include":"#define-trait"},{"include":"#use-trait"}],"repository":{"built-in-func":{"name":"meta.built-in-function","begin":"(?x) (\\() \\s* (\\-|\\+|\u003c\\=|\u003e\\=|\u003c|\u003e|\\*|/|and|append|as-contract|as-max-len\\?|asserts!|at-block|begin|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|buff-to-int-be|buff-to-int-le|buff-to-uint-be|buff-to-uint-le|concat|contract-call\\?|contract-of|default-to|element-at|element-at\\?|filter|fold|from-consensus-buff\\?|ft-burn\\?|ft-get-balance|ft-get-supply|ft-mint\\?|ft-transfer\\?|get-block-info\\?|get-burn-block-info\\?|hash160|if|impl-trait|index-of|index-of\\?|int-to-ascii|int-to-utf8|is-eq|is-err|is-none|is-ok|is-some|is-standard|keccak256|len|log2|map|match|merge|mod|nft-burn\\?|nft-get-owner\\?|nft-mint\\?|nft-transfer\\?|not|or|pow|principal-construct\\?|principal-destruct\\?|principal-of\\?|print|replace-at\\?|secp256k1-recover\\?|secp256k1-verify|sha256|sha512|sha512/256|slice\\?|sqrti|string-to-int\\?|string-to-uint\\?|stx-account|stx-burn\\?|stx-get-balance|stx-transfer-memo\\?|stx-transfer\\?|to-consensus-buff\\?|to-int|to-uint|try!|unwrap!|unwrap-err!|unwrap-err-panic|unwrap-panic|xor) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.built-in-function.start.clarity"},"2":{"name":"keyword.declaration.built-in-function.clarity"}},"endCaptures":{"1":{"name":"punctuation.built-in-function.end.clarity"}}},"comment":{"name":"comment.line.semicolon.clarity","match":"(?x) (?\u003c=^|[()\\[\\]{}\",'`;\\s]) (;) .* $"},"data-type":{"patterns":[{"include":"#comment"},{"name":"entity.name.type.numeric.clarity","match":"\\b(uint|int)\\b"},{"name":"entity.name.type.principal.clarity","match":"\\b(principal)\\b"},{"name":"entity.name.type.bool.clarity","match":"\\b(bool)\\b"},{"match":"(?x) (\\() \\s* (?:(string-ascii|string-utf8)\\s+(\\d+)) \\s* (\\))","captures":{"1":{"name":"punctuation.string_type-def.start.clarity"},"2":{"name":"entity.name.type.string_type.clarity"},"3":{"name":"constant.numeric.string_type-len.clarity"},"4":{"name":"punctuation.string_type-def.end.clarity"}}},{"match":"(?x) (\\() \\s* (buff)\\s+(\\d+)\\s* (\\))","captures":{"1":{"name":"punctuation.buff-def.start.clarity"},"2":{"name":"entity.name.type.buff.clarity"},"3":{"name":"constant.numeric.buf-len.clarity"},"4":{"name":"punctuation.buff-def.end.clarity"}}},{"name":"meta.optional-def","begin":"(?x) (\\() \\s* (optional)\\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.optional-def.start.clarity"},"2":{"name":"storage.type.modifier"}},"endCaptures":{"1":{"name":"punctuation.optional-def.end.clarity"}}},{"name":"meta.response-def","begin":"(?x) (\\() \\s* (response)\\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.response-def.start.clarity"},"2":{"name":"storage.type.modifier"}},"endCaptures":{"1":{"name":"punctuation.response-def.end.clarity"}}},{"name":"meta.list-def","begin":"(?x) (\\() \\s* (list) \\s+ (\\d+) \\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.list-def.start.clarity"},"2":{"name":"entity.name.type.list.clarity"},"3":{"name":"constant.numeric.list-len.clarity"}},"endCaptures":{"1":{"name":"punctuation.list-def.end.clarity"}}},{"name":"meta.tuple-def","begin":"(\\{)","end":"(\\})","patterns":[{"name":"entity.name.tag.tuple-data-type-key.clarity","match":"([a-zA-Z][\\w\\?\\!\\-]*)(?=:)"},{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.tuple-def.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.tuple-def.end.clarity"}}}]},"define-constant":{"name":"meta.define-constant","begin":"(?x) (\\() \\s* (define-constant) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.define-constant.start.clarity"},"2":{"name":"keyword.declaration.define-constant.clarity"},"3":{"name":"entity.name.constant-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-constant.end.clarity"}}},"define-data-var":{"name":"meta.define-data-var","begin":"(?x) (\\() \\s* (define-data-var) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"},{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.define-data-var.start.clarity"},"2":{"name":"keyword.declaration.define-data-var.clarity"},"3":{"name":"entity.name.data-var-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-data-var.end.clarity"}}},"define-function":{"name":"meta.define-function","begin":"(?x) (\\() \\s* (define-(?:public|private|read-only)) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"name":"meta.define-function-signature","begin":"(?x) (\\() \\s* ([a-zA-Z][\\w\\?\\!\\-]*) \\s*","end":"(\\))","patterns":[{"name":"meta.function-argument","begin":"(?x) (\\() \\s* ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.function-argument.start.clarity"},"2":{"name":"variable.parameter.clarity"}},"endCaptures":{"1":{"name":"punctuation.function-argument.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.function-signature.start.clarity"},"2":{"name":"entity.name.function.clarity"}},"endCaptures":{"1":{"name":"punctuation.function-signature.end.clarity"}}},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.define-function.start.clarity"},"2":{"name":"keyword.declaration.define-function.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-function.end.clarity"}}},"define-fungible-token":{"match":"(?x) (\\() \\s* (define-fungible-token) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) (?:\\s+(u\\d+))?","captures":{"1":{"name":"punctuation.define-fungible-token.start.clarity"},"2":{"name":"keyword.declaration.define-fungible-token.clarity"},"3":{"name":"entity.name.fungible-token-name.clarity variable.other.clarity"},"4":{"name":"constant.numeric.fungible-token-total-supply.clarity"},"5":{"name":"punctuation.define-fungible-token.end.clarity"}}},"define-map":{"name":"meta.define-map","begin":"(?x) (\\() \\s* (define-map) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"},{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.define-map.start.clarity"},"2":{"name":"keyword.declaration.define-map.clarity"},"3":{"name":"entity.name.map-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-map.end.clarity"}}},"define-non-fungible-token":{"name":"meta.define-non-fungible-token","begin":"(?x) (\\() \\s* (define-non-fungible-token) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.define-non-fungible-token.start.clarity"},"2":{"name":"keyword.declaration.define-non-fungible-token.clarity"},"3":{"name":"entity.name.non-fungible-token-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-non-fungible-token.end.clarity"}}},"define-trait":{"name":"meta.define-trait","begin":"(?x) (\\() \\s* (define-trait) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"name":"meta.define-trait-body","begin":"(?x) (\\() \\s*","end":"(\\))","patterns":[{"include":"#expression"},{"name":"meta.trait-function","begin":"(?x) (\\() \\s* ([a-zA-Z][\\w\\!\\?\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"},{"name":"meta.trait-function-args","begin":"(?x) (\\() \\s*","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.trait-function-args.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.trait-function-args.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.trait-function.start.clarity"},"2":{"name":"entity.name.function.clarity"}},"endCaptures":{"1":{"name":"punctuation.trait-function.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.define-trait-body.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-trait-body.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.define-trait.start.clarity"},"2":{"name":"keyword.declaration.define-trait.clarity"},"3":{"name":"entity.name.trait-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-trait.end.clarity"}}},"expression":{"patterns":[{"include":"#comment"},{"include":"#keyword"},{"include":"#literal"},{"include":"#let-func"},{"include":"#built-in-func"},{"include":"#get-set-func"}]},"get-set-func":{"name":"meta.get-set-func","begin":"(?x) (\\() \\s* (var-get|var-set|map-get\\?|map-set|map-insert|map-delete|get) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s*","end":"(\\))","patterns":[{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.get-set-func.start.clarity"},"2":{"name":"keyword.control.clarity"},"3":{"name":"variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.get-set-func.end.clarity"}}},"keyword":{"name":"constant.language.clarity","match":"(?\u003c!\\S)(?!-)\\b(?:block-height|burn-block-height|chain-id|contract-caller|is-in-regtest|stx-liquid-supply|tx-sender|tx-sponsor?)\\b(?!\\s*-)"},"let-func":{"name":"meta.let-function","begin":"(?x) (\\() \\s* (let) \\s*","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"},{"name":"meta.let-var","begin":"(?x) (\\() \\s*","end":"(\\))","patterns":[{"name":"meta.let-local-var","begin":"(?x) (\\() ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.let-local-var.start.clarity"},"2":{"name":"entity.name.let-local-var-name.clarity variable.parameter.clarity"}},"endCaptures":{"1":{"name":"punctuation.let-local-var.end.clarity"}}},{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.let-var.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.let-var.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.let-function.start.clarity"},"2":{"name":"keyword.declaration.let-function.clarity"}},"endCaptures":{"1":{"name":"punctuation.let-function.end.clarity"}}},"literal":{"patterns":[{"include":"#number-literal"},{"include":"#bool-literal"},{"include":"#string-literal"},{"include":"#tuple-literal"},{"include":"#principal-literal"},{"include":"#list-literal"},{"include":"#optional-literal"},{"include":"#response-literal"}],"repository":{"bool-literal":{"name":"constant.language.bool.clarity","match":"(?\u003c!\\S)(?!-)\\b(true|false)\\b(?!\\s*-)"},"list-literal":{"name":"meta.list","begin":"(?x) (\\() \\s* (list) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.list.start.clarity"},"2":{"name":"entity.name.type.list.clarity"}},"endCaptures":{"1":{}}},"number-literal":{"patterns":[{"name":"constant.numeric.uint.clarity","match":"(?\u003c!\\S)(?!-)\\bu\\d+\\b(?!\\s*-)"},{"name":"constant.numeric.int.clarity","match":"(?\u003c!\\S)(?!-)\\b\\d+\\b(?!\\s*-)"},{"name":"constant.numeric.hex.clarity","match":"(?\u003c!\\S)(?!-)\\b0x[0-9a-f]*\\b(?!\\s*-)"}]},"optional-literal":{"patterns":[{"name":"constant.language.none.clarity","match":"(?\u003c!\\S)(?!-)\\b(none)\\b(?!\\s*-)"},{"name":"meta.some","begin":"(?x) (\\() \\s* (some) \\s+","end":"(\\))","patterns":[{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.some.start.clarity"},"2":{"name":"constant.language.some.clarity"}},"endCaptures":{"1":{"name":"punctuation.some.end.clarity"}}}]},"principal-literal":{"name":"constant.other.principal.clarity","match":"(?x) \\'[0-9A-Z]{28,41}(:?\\.[a-zA-Z][a-zA-Z0-9\\-]+){0,2} | (\\.[a-zA-Z][a-zA-Z0-9\\-]*){1,2} (?=[\\s(){},]|$)"},"response-literal":{"name":"meta.response","begin":"(?x) (\\() \\s* (ok|err) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.response.start.clarity"},"2":{"name":"constant.language.ok-err.clarity"}},"endCaptures":{"1":{"name":"punctuation.response.end.clarity"}}},"string-literal":{"patterns":[{"name":"string.quoted.double.clarity","begin":"(u?)(\")","end":"\"","patterns":[{"name":"constant.character.escape.quote","match":"\\\\."}],"beginCaptures":{"1":{"name":"string.quoted.utf8.clarity"},"2":{"name":"punctuation.definition.string.begin.clarity"}},"endCaptures":{"1":{"name":"punctuation.definition.string.end.clarity"}}}]},"tuple-literal":{"name":"meta.tuple","begin":"(\\{)","end":"(\\})","patterns":[{"name":"entity.name.tag.tuple-key.clarity","match":"([a-zA-Z][\\w\\?\\!\\-]*)(?=:)"},{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.tuple.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.tuple.end.clarity"}}}}},"use-trait":{"name":"meta.use-trait","begin":"(?x) (\\() \\s* (use-trait) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#literal"}],"beginCaptures":{"1":{"name":"punctuation.use-trait.start.clarity"},"2":{"name":"keyword.declaration.use-trait.clarity"},"3":{"name":"entity.name.trait-alias.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.use-trait.end.clarity"}}},"user-func":{"name":"meta.user-function","begin":"(?x) (\\() \\s* (([a-zA-Z][\\w\\?\\!\\-]*)) \\s*","end":"(\\))","patterns":[{"include":"#expression"},{"include":"$self"}],"beginCaptures":{"1":{"name":"punctuation.user-function.start.clarity"},"2":{"name":"entity.name.function.clarity"}},"endCaptures":{"1":{"name":"punctuation.user-function.end.clarity"}}}}} +{"name":"clarity","scopeName":"source.clar","patterns":[{"include":"#expression"},{"include":"#define-constant"},{"include":"#define-data-var"},{"include":"#define-map"},{"include":"#define-function"},{"include":"#define-fungible-token"},{"include":"#define-non-fungible-token"},{"include":"#define-trait"},{"include":"#use-trait"}],"repository":{"built-in-func":{"name":"meta.built-in-function","begin":"(?x) (\\() \\s* (\\-|\\+|\u003c\\=|\u003e\\=|\u003c|\u003e|\\*|/|and|append|as-contract|as-max-len\\?|asserts!|at-block|begin|bit-and|bit-not|bit-or|bit-shift-left|bit-shift-right|bit-xor|buff-to-int-be|buff-to-int-le|buff-to-uint-be|buff-to-uint-le|concat|contract-call\\?|contract-of|default-to|element-at|element-at\\?|filter|fold|from-consensus-buff\\?|ft-burn\\?|ft-get-balance|ft-get-supply|ft-mint\\?|ft-transfer\\?|get-block-info\\?|get-burn-block-info\\?|get-stacks-block-info\\?|get-tenure-info\\?|hash160|if|impl-trait|index-of|index-of\\?|int-to-ascii|int-to-utf8|is-eq|is-err|is-none|is-ok|is-some|is-standard|keccak256|len|log2|map|match|merge|mod|nft-burn\\?|nft-get-owner\\?|nft-mint\\?|nft-transfer\\?|not|or|pow|principal-construct\\?|principal-destruct\\?|principal-of\\?|print|replace-at\\?|secp256k1-recover\\?|secp256k1-verify|sha256|sha512|sha512/256|slice\\?|sqrti|string-to-int\\?|string-to-uint\\?|stx-account|stx-burn\\?|stx-get-balance|stx-transfer-memo\\?|stx-transfer\\?|to-consensus-buff\\?|to-int|to-uint|try!|unwrap!|unwrap-err!|unwrap-err-panic|unwrap-panic|xor) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.built-in-function.start.clarity"},"2":{"name":"keyword.declaration.built-in-function.clarity"}},"endCaptures":{"1":{"name":"punctuation.built-in-function.end.clarity"}}},"comment":{"name":"comment.line.semicolon.clarity","match":"(?x) (?\u003c=^|[()\\[\\]{}\",'`;\\s]) (;) .* $"},"data-type":{"patterns":[{"include":"#comment"},{"name":"entity.name.type.numeric.clarity","match":"\\b(uint|int)\\b"},{"name":"entity.name.type.principal.clarity","match":"\\b(principal)\\b"},{"name":"entity.name.type.bool.clarity","match":"\\b(bool)\\b"},{"match":"(?x) (\\() \\s* (?:(string-ascii|string-utf8)\\s+(\\d+)) \\s* (\\))","captures":{"1":{"name":"punctuation.string_type-def.start.clarity"},"2":{"name":"entity.name.type.string_type.clarity"},"3":{"name":"constant.numeric.string_type-len.clarity"},"4":{"name":"punctuation.string_type-def.end.clarity"}}},{"match":"(?x) (\\() \\s* (buff)\\s+(\\d+)\\s* (\\))","captures":{"1":{"name":"punctuation.buff-def.start.clarity"},"2":{"name":"entity.name.type.buff.clarity"},"3":{"name":"constant.numeric.buf-len.clarity"},"4":{"name":"punctuation.buff-def.end.clarity"}}},{"name":"meta.optional-def","begin":"(?x) (\\() \\s* (optional)\\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.optional-def.start.clarity"},"2":{"name":"storage.type.modifier"}},"endCaptures":{"1":{"name":"punctuation.optional-def.end.clarity"}}},{"name":"meta.response-def","begin":"(?x) (\\() \\s* (response)\\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.response-def.start.clarity"},"2":{"name":"storage.type.modifier"}},"endCaptures":{"1":{"name":"punctuation.response-def.end.clarity"}}},{"name":"meta.list-def","begin":"(?x) (\\() \\s* (list) \\s+ (\\d+) \\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.list-def.start.clarity"},"2":{"name":"entity.name.type.list.clarity"},"3":{"name":"constant.numeric.list-len.clarity"}},"endCaptures":{"1":{"name":"punctuation.list-def.end.clarity"}}},{"name":"meta.tuple-def","begin":"(\\{)","end":"(\\})","patterns":[{"name":"entity.name.tag.tuple-data-type-key.clarity","match":"([a-zA-Z][\\w\\?\\!\\-]*)(?=:)"},{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.tuple-def.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.tuple-def.end.clarity"}}}]},"define-constant":{"name":"meta.define-constant","begin":"(?x) (\\() \\s* (define-constant) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.define-constant.start.clarity"},"2":{"name":"keyword.declaration.define-constant.clarity"},"3":{"name":"entity.name.constant-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-constant.end.clarity"}}},"define-data-var":{"name":"meta.define-data-var","begin":"(?x) (\\() \\s* (define-data-var) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"},{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.define-data-var.start.clarity"},"2":{"name":"keyword.declaration.define-data-var.clarity"},"3":{"name":"entity.name.data-var-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-data-var.end.clarity"}}},"define-function":{"name":"meta.define-function","begin":"(?x) (\\() \\s* (define-(?:public|private|read-only)) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"name":"meta.define-function-signature","begin":"(?x) (\\() \\s* ([a-zA-Z][\\w\\?\\!\\-]*) \\s*","end":"(\\))","patterns":[{"name":"meta.function-argument","begin":"(?x) (\\() \\s* ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.function-argument.start.clarity"},"2":{"name":"variable.parameter.clarity"}},"endCaptures":{"1":{"name":"punctuation.function-argument.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.function-signature.start.clarity"},"2":{"name":"entity.name.function.clarity"}},"endCaptures":{"1":{"name":"punctuation.function-signature.end.clarity"}}},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.define-function.start.clarity"},"2":{"name":"keyword.declaration.define-function.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-function.end.clarity"}}},"define-fungible-token":{"match":"(?x) (\\() \\s* (define-fungible-token) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) (?:\\s+(u\\d+))?","captures":{"1":{"name":"punctuation.define-fungible-token.start.clarity"},"2":{"name":"keyword.declaration.define-fungible-token.clarity"},"3":{"name":"entity.name.fungible-token-name.clarity variable.other.clarity"},"4":{"name":"constant.numeric.fungible-token-total-supply.clarity"},"5":{"name":"punctuation.define-fungible-token.end.clarity"}}},"define-map":{"name":"meta.define-map","begin":"(?x) (\\() \\s* (define-map) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"},{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.define-map.start.clarity"},"2":{"name":"keyword.declaration.define-map.clarity"},"3":{"name":"entity.name.map-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-map.end.clarity"}}},"define-non-fungible-token":{"name":"meta.define-non-fungible-token","begin":"(?x) (\\() \\s* (define-non-fungible-token) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.define-non-fungible-token.start.clarity"},"2":{"name":"keyword.declaration.define-non-fungible-token.clarity"},"3":{"name":"entity.name.non-fungible-token-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-non-fungible-token.end.clarity"}}},"define-trait":{"name":"meta.define-trait","begin":"(?x) (\\() \\s* (define-trait) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"name":"meta.define-trait-body","begin":"(?x) (\\() \\s*","end":"(\\))","patterns":[{"include":"#expression"},{"name":"meta.trait-function","begin":"(?x) (\\() \\s* ([a-zA-Z][\\w\\!\\?\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#data-type"},{"name":"meta.trait-function-args","begin":"(?x) (\\() \\s*","end":"(\\))","patterns":[{"include":"#data-type"}],"beginCaptures":{"1":{"name":"punctuation.trait-function-args.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.trait-function-args.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.trait-function.start.clarity"},"2":{"name":"entity.name.function.clarity"}},"endCaptures":{"1":{"name":"punctuation.trait-function.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.define-trait-body.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-trait-body.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.define-trait.start.clarity"},"2":{"name":"keyword.declaration.define-trait.clarity"},"3":{"name":"entity.name.trait-name.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.define-trait.end.clarity"}}},"expression":{"patterns":[{"include":"#comment"},{"include":"#keyword"},{"include":"#literal"},{"include":"#let-func"},{"include":"#built-in-func"},{"include":"#get-set-func"}]},"get-set-func":{"name":"meta.get-set-func","begin":"(?x) (\\() \\s* (var-get|var-set|map-get\\?|map-set|map-insert|map-delete|get) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s*","end":"(\\))","patterns":[{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.get-set-func.start.clarity"},"2":{"name":"keyword.control.clarity"},"3":{"name":"variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.get-set-func.end.clarity"}}},"keyword":{"name":"constant.language.clarity","match":"(?\u003c!\\S)(?!-)\\b(?:block-height|burn-block-height|chain-id|contract-caller|is-in-regtest|stacks-block-height|stx-liquid-supply|tenure-height|tx-sender|tx-sponsor?)\\b(?!\\s*-)"},"let-func":{"name":"meta.let-function","begin":"(?x) (\\() \\s* (let) \\s*","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"},{"name":"meta.let-var","begin":"(?x) (\\() \\s*","end":"(\\))","patterns":[{"name":"meta.let-local-var","begin":"(?x) (\\() ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.let-local-var.start.clarity"},"2":{"name":"entity.name.let-local-var-name.clarity variable.parameter.clarity"}},"endCaptures":{"1":{"name":"punctuation.let-local-var.end.clarity"}}},{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.let-var.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.let-var.end.clarity"}}}],"beginCaptures":{"1":{"name":"punctuation.let-function.start.clarity"},"2":{"name":"keyword.declaration.let-function.clarity"}},"endCaptures":{"1":{"name":"punctuation.let-function.end.clarity"}}},"literal":{"patterns":[{"include":"#number-literal"},{"include":"#bool-literal"},{"include":"#string-literal"},{"include":"#tuple-literal"},{"include":"#principal-literal"},{"include":"#list-literal"},{"include":"#optional-literal"},{"include":"#response-literal"}],"repository":{"bool-literal":{"name":"constant.language.bool.clarity","match":"(?\u003c!\\S)(?!-)\\b(true|false)\\b(?!\\s*-)"},"list-literal":{"name":"meta.list","begin":"(?x) (\\() \\s* (list) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.list.start.clarity"},"2":{"name":"entity.name.type.list.clarity"}},"endCaptures":{"1":{}}},"number-literal":{"patterns":[{"name":"constant.numeric.uint.clarity","match":"(?\u003c!\\S)(?!-)\\bu\\d+\\b(?!\\s*-)"},{"name":"constant.numeric.int.clarity","match":"(?\u003c!\\S)(?!-)\\b\\d+\\b(?!\\s*-)"},{"name":"constant.numeric.hex.clarity","match":"(?\u003c!\\S)(?!-)\\b0x[0-9a-f]*\\b(?!\\s*-)"}]},"optional-literal":{"patterns":[{"name":"constant.language.none.clarity","match":"(?\u003c!\\S)(?!-)\\b(none)\\b(?!\\s*-)"},{"name":"meta.some","begin":"(?x) (\\() \\s* (some) \\s+","end":"(\\))","patterns":[{"include":"#expression"}],"beginCaptures":{"1":{"name":"punctuation.some.start.clarity"},"2":{"name":"constant.language.some.clarity"}},"endCaptures":{"1":{"name":"punctuation.some.end.clarity"}}}]},"principal-literal":{"name":"constant.other.principal.clarity","match":"(?x) \\'[0-9A-Z]{28,41}(:?\\.[a-zA-Z][a-zA-Z0-9\\-]+){0,2} | (\\.[a-zA-Z][a-zA-Z0-9\\-]*){1,2} (?=[\\s(){},]|$)"},"response-literal":{"name":"meta.response","begin":"(?x) (\\() \\s* (ok|err) \\s+","end":"(\\))","patterns":[{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.response.start.clarity"},"2":{"name":"constant.language.ok-err.clarity"}},"endCaptures":{"1":{"name":"punctuation.response.end.clarity"}}},"string-literal":{"patterns":[{"name":"string.quoted.double.clarity","begin":"(u?)(\")","end":"\"","patterns":[{"name":"constant.character.escape.quote","match":"\\\\."}],"beginCaptures":{"1":{"name":"string.quoted.utf8.clarity"},"2":{"name":"punctuation.definition.string.begin.clarity"}},"endCaptures":{"1":{"name":"punctuation.definition.string.end.clarity"}}}]},"tuple-literal":{"name":"meta.tuple","begin":"(\\{)","end":"(\\})","patterns":[{"name":"entity.name.tag.tuple-key.clarity","match":"([a-zA-Z][\\w\\?\\!\\-]*)(?=:)"},{"include":"#expression"},{"include":"#user-func"}],"beginCaptures":{"1":{"name":"punctuation.tuple.start.clarity"}},"endCaptures":{"1":{"name":"punctuation.tuple.end.clarity"}}}}},"use-trait":{"name":"meta.use-trait","begin":"(?x) (\\() \\s* (use-trait) \\s+ ([a-zA-Z][\\w\\?\\!\\-]*) \\s+","end":"(\\))","patterns":[{"include":"#literal"}],"beginCaptures":{"1":{"name":"punctuation.use-trait.start.clarity"},"2":{"name":"keyword.declaration.use-trait.clarity"},"3":{"name":"entity.name.trait-alias.clarity variable.other.clarity"}},"endCaptures":{"1":{"name":"punctuation.use-trait.end.clarity"}}},"user-func":{"name":"meta.user-function","begin":"(?x) (\\() \\s* (([a-zA-Z][\\w\\?\\!\\-]*)) \\s*","end":"(\\))","patterns":[{"include":"#expression"},{"include":"$self"}],"beginCaptures":{"1":{"name":"punctuation.user-function.start.clarity"},"2":{"name":"entity.name.function.clarity"}},"endCaptures":{"1":{"name":"punctuation.user-function.end.clarity"}}}}}