From 9934fa9e19b365e64588af6af39ba8b9b683ac2c Mon Sep 17 00:00:00 2001 From: Titus Wormer Date: Mon, 2 Sep 2024 12:25:12 +0200 Subject: [PATCH] Regenerate for `linguist@8.0.0` * add `source.cairo0`, `source.cylc`, `source.dune`, `source.iCalendar`, `source.livecodescript`, `source.nr`, `source.powerbuilder`, `source.vcard`, `text.html.jte` * change source of `source.just`, `source.mcfunction`, `source.qsharp`, `source.wdl` * rename `source.pegjs` to `source.peggy` * update a bunch of grammars For more info, see: * [`github-linguist/linguist@8.0.0`](https://github.com/github-linguist/linguist/releases/tag/v8.0.0) --- lang/go.mod.js | 2 +- lang/go.sum.js | 2 +- lang/source.abl.js | 853 +++++++++++++++----- lang/source.basic.js | 2 +- lang/source.bicep.js | 2 +- lang/source.cairo.js | 552 +++++++++---- lang/source.cairo0.js | 107 +++ lang/source.clar.js | 4 +- lang/source.clarion.js | 12 +- lang/source.commonlisp.js | 16 +- lang/source.cs.js | 6 +- lang/source.csswg.js | 2 +- lang/source.curlrc.js | 10 +- lang/source.curry.js | 4 +- lang/source.cylc.js | 516 ++++++++++++ lang/source.dart.js | 2 +- lang/source.dune.js | 194 +++++ lang/source.elvish.js | 10 +- lang/source.fsharp.js | 6 +- lang/source.gdscript.js | 122 ++- lang/source.generic-db.js | 4 +- lang/source.gitconfig.js | 190 ++++- lang/source.gleam.js | 28 +- lang/source.hosts.js | 184 ++++- lang/source.iCalendar.js | 77 ++ lang/source.ice.js | 12 +- lang/source.julia.js | 43 +- lang/source.just.js | 379 ++++++++- lang/source.lilypond.js | 455 ++++------- lang/source.livecodescript.js | 195 +++++ lang/source.luau.js | 16 +- lang/source.matlab.js | 175 +++-- lang/source.mcfunction.js | 920 ++++++++-------------- lang/source.mdx.js | 1040 ++++++++++++++++++++----- lang/source.mo.js | 2 +- lang/source.move.js | 95 ++- lang/source.nanorc.js | 410 +++++++--- lang/source.nr.js | 199 +++++ lang/source.p4.js | 19 +- lang/source.peggy.js | 94 +++ lang/source.pegjs.js | 179 +---- lang/source.polar.js | 17 +- lang/source.powerbuilder.js | 305 ++++++++ lang/source.qsharp.js | 51 +- lang/source.rpgle.js | 36 +- lang/source.rust.js | 9 +- lang/source.sourcepawn.js | 2 +- lang/source.stan.js | 193 ++--- lang/source.swift.js | 6 +- lang/source.sy.js | 2 +- lang/source.textproto.js | 2 +- lang/source.v.js | 4 +- lang/source.vba.js | 17 +- lang/source.vbnet.js | 10 +- lang/source.vcard.js | 73 ++ lang/source.viml.js | 2 +- lang/source.wdl.js | 308 +++++--- lang/text.adblock.js | 3 +- lang/text.html.jte.js | 311 ++++++++ lang/text.html.statamic.js | 3 +- lang/text.md.js | 1040 ++++++++++++++++++++----- lang/text.robot.js | 2 +- lang/text.roff.js | 1 - lib/all.js | 22 +- notice | 1383 ++++++++++++++++++++++++++------- readme.md | 29 +- script/build.js | 2 + script/graph.yml | 20 + script/info.js | 88 ++- 69 files changed, 8201 insertions(+), 2880 deletions(-) create mode 100644 lang/source.cairo0.js create mode 100644 lang/source.cylc.js create mode 100644 lang/source.dune.js create mode 100644 lang/source.iCalendar.js create mode 100644 lang/source.livecodescript.js create mode 100644 lang/source.nr.js create mode 100644 lang/source.peggy.js create mode 100644 lang/source.powerbuilder.js create mode 100644 lang/source.vcard.js create mode 100644 lang/text.html.jte.js diff --git a/lang/go.mod.js b/lang/go.mod.js index 1f4d650..af67c9b 100644 --- a/lang/go.mod.js +++ b/lang/go.mod.js @@ -1,7 +1,7 @@ // This is a TextMate grammar distributed by `starry-night`. // This grammar is developed at // -// and licensed permissive. +// and licensed `mit`. // See for more info. /** * @import {Grammar} from '@wooorm/starry-night' diff --git a/lang/go.sum.js b/lang/go.sum.js index 6845bc2..efdc12b 100644 --- a/lang/go.sum.js +++ b/lang/go.sum.js @@ -1,7 +1,7 @@ // This is a TextMate grammar distributed by `starry-night`. // This grammar is developed at // -// and licensed permissive. +// and licensed `mit`. // See for more info. /** * @import {Grammar} from '@wooorm/starry-night' diff --git a/lang/source.abl.js b/lang/source.abl.js index 2c5e9b6..469f7f8 100644 --- a/lang/source.abl.js +++ b/lang/source.abl.js @@ -42,7 +42,7 @@ const grammar = { }, 'abl-functions-A': { begin: - '(?i)\\s*(ABSOLUTE|ACCUM|ADD-INTERVAL|ALIAS|AMBIGUOUS|ASC|AUDIT-ENABLED|AVAILABLE)\\s*(?=\\()', + '(?i)\\s*(available|audit-enabled|asc|ambiguous|alias|add-interval|accum|absolute|absolut|absolu|absol|abso|abs)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -51,7 +51,7 @@ const grammar = { }, 'abl-functions-B': { begin: - '(?i)\\s*(BASE64-DECODE|BASE64-ENCODE|BOX|BUFFER-GROUP-ID|BUFFER-GROUP-NAME|BUFFER-PARTITION-ID|BUFFER-TENANT-ID|BUFFER-TENANT-NAME)\\s*(?=\\()', + '(?i)\\s*(buffer-tenant-name|buffer-tenant-id|buffer-partition-id|buffer-group-name|buffer-group-id|box|base64-encode|base64-decode)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -60,7 +60,7 @@ const grammar = { }, 'abl-functions-C': { begin: - '(?i)\\s*(CAN-DO|CAN-FIND|CAN-QUERY|CAN-SET|CAPS|CAST|CHR|CODEPAGE-CONVERT|COMPARE|CONNECTED|COUNT-OF|CURRENT-CHANGED|CURRENT-LANGUAGE|CURRENT-RESULT-ROW|CURRENT-VALUE)\\s*(?=\\()', + '(?i)\\s*(current-value|current-result-row|current-language|current-languag|current-langua|current-langu|current-lang|current-changed|count-of|connected|compare|codepage-convert|chr|cast|caps|can-set|can-query|can-find|can-do)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -69,7 +69,7 @@ const grammar = { }, 'abl-functions-D': { begin: - '(?i)\\s*(DATASERVERS|DATA-SOURCE-MODIFIED|DATE|DATETIME|DATETIME-TZ|DAY|DBCODEPAGE|DBCOLLATION|DBNAME|DBPARAM|DB-REMOTE-HOST|DBRESTRICTIONS|DBTASKID|DBTYPE|DBVERSION|DECIMAL|DECRYPT|DEFINED|DYNAMIC-CAST|DYNAMIC-CURRENT-VALUE|DYNAMIC-ENUM|DYNAMIC-FUNCTION|DYNAMIC-INVOKE|DYNAMIC-NEXT-VALUE|DYNAMIC-PROPERTY)\\s*(?=\\()', + '(?i)\\s*(dynamic-property|dynamic-next-value|dynamic-invoke|dynamic-function|dynamic-functio|dynamic-functi|dynamic-funct|dynamic-func|dynamic-enum|dynamic-current-value|dynamic-cast|defined|decrypt|decimal|decima|decim|deci|dec|dbversion|dbversio|dbversi|dbvers|dbtype|dbtaskid|dbrestrictions|dbrestriction|dbrestrictio|dbrestricti|dbrestrict|dbrestric|dbrestri|dbrestr|dbrest|dbparam|dbname|dbcollation|dbcodepage|db-remote-host|day|datetime-tz|datetime|date|dataservers|data-source-modified)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -78,7 +78,7 @@ const grammar = { }, 'abl-functions-E': { begin: - '(?i)\\s*(ENCODE|ENCRYPT|ENTERED|ENTRY|ERROR|ETIME|EXP|EXTENT)\\s*(?=\\()', + '(?i)\\s*(extent|exp|etime|error|entry|entered|encrypt|encode)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -87,7 +87,7 @@ const grammar = { }, 'abl-functions-F': { begin: - '(?i)\\s*(FILL|FIRST|FIRST-OF|FRAME-COL|FRAME-DB|FRAME-DOWN|FRAME-FIELD|FRAME-FILE|FRAME-INDEX|FRAME-LINE|FRAME-NAME|FRAME-ROW|FRAME-VALUE)\\s*(?=\\()', + '(?i)\\s*(frame-value|frame-valu|frame-val|frame-row|frame-name|frame-line|frame-index|frame-inde|frame-file|frame-field|frame-down|frame-db|frame-col|first-of|first|fill)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -96,7 +96,7 @@ const grammar = { }, 'abl-functions-G': { begin: - '(?i)\\s*(GATEWAYS|GENERATE-PBE-KEY|GENERATE-PBE-SALT|GENERATE-RANDOM-KEY|GENERATE-UUID|GET-BITS|GET-BYTE|GET-BYTE-ORDER|GET-BYTES|GET-CLASS|GET-CODEPAGE|GET-CODEPAGES|GET-COLLATION|GET-COLLATIONS|GET-DB-CLIENT|GET-DOUBLE|GET-EFFECTIVE-TENANT-ID|GET-EFFECTIVE-TENANT-NAME|GET-FLOAT|GET-INT64|GET-LONG|GET-POINTER-VALUE|GET-SHORT|GET-SIZE|GET-STRING|GET-UNSIGNED-LONG|GET-UNSIGNED-SHORT|GO-PENDING|GUID)\\s*(?=\\()', + '(?i)\\s*(guid|go-pending|go-pendin|go-pendi|go-pend|get-unsigned-short|get-unsigned-long|get-string|get-size|get-short|get-pointer-value|get-long|get-int64|get-float|get-effective-tenant-name|get-effective-tenant-id|get-double|get-db-client|get-collations|get-collation|get-collatio|get-collati|get-collat|get-colla|get-coll|get-codepages|get-codepage|get-class|get-bytes|get-byte-order|get-byte|get-bits|generate-uuid|generate-random-key|generate-pbe-salt|generate-pbe-key|gateways|gateway)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -104,7 +104,7 @@ const grammar = { patterns: [{include: '#function-arguments'}] }, 'abl-functions-H': { - begin: '(?i)\\s*(HANDLE|HASH-CODE|HEX-DECODE|HEX-ENCODE)\\s*(?=\\()', + begin: '(?i)\\s*(hex-encode|hex-decode|hash-code|handle)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -113,7 +113,7 @@ const grammar = { }, 'abl-functions-I': { begin: - '(?i)\\s*(INDEX|INPUT|INT64|INTEGER|INTERVAL|IS-ATTR-SPACE|IS-CODEPAGE-FIXED|IS-COLUMN-CODEPAGE|IS-DB-MULTI-TENANT|IS-LEAD-BYTE|ISO-DATE)\\s*(?=\\()', + '(?i)\\s*(iso-date|is-lead-byte|is-db-multi-tenant|is-column-codepage|is-codepage-fixed|is-attr-space|is-attr-spac|is-attr-spa|is-attr-sp|is-attr-s|is-attr-|is-attr|interval|integer|intege|integ|inte|int64|int|input|index)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -122,7 +122,7 @@ const grammar = { }, 'abl-functions-K': { begin: - '(?i)\\s*(KBLABEL|KEYCODE|KEYFUNCTION|KEYLABEL|KEYWORD|KEYWORD-ALL)\\s*(?=\\()', + '(?i)\\s*(keyword-all|keyword|keylabel|keyfunction|keyfunctio|keyfuncti|keyfunct|keyfunc|keycode|kblabel)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -131,7 +131,7 @@ const grammar = { }, 'abl-functions-L': { begin: - '(?i)\\s*(LAST|LASTKEY|LAST-OF|LC|LDBNAME|LEFT-TRIM|LENGTH|LIBRARY|LINE-COUNTER|LIST-EVENTS|LIST-QUERY-ATTRS|LIST-SET-ATTRS|LIST-WIDGETS|LOCKED|LOG|LOGICAL|LOOKUP|lower)\\s*(?=\\()', + '(?i)\\s*(lower|lookup|logical|log|locked|list-widgets|list-set-attrs|list-query-attrs|list-events|line-counter|line-counte|line-count|library|length|left-trim|ldbname|lc|lastkey|last-of|last)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -140,7 +140,7 @@ const grammar = { }, 'abl-functions-M': { begin: - '(?i)\\s*(MAXIMUM|MD5-DIGEST|MEMBER|MESSAGE-DIGEST|MESSAGE-LINES|MINIMUM|MONTH|MTIME)\\s*(?=\\()', + '(?i)\\s*(mtime|month|minimum|minimu|minim|mini|min|message-lines|message-digest|member|md5-digest|maximum)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -149,7 +149,7 @@ const grammar = { }, 'abl-functions-N': { begin: - '(?i)\\s*(NEXT-VALUE|NORMALIZE|NOT ENTERED|NOW|NUM-ALIASES|NUM-DBS|NUM-ENTRIES|NUM-RESULTS)\\s*(?=\\()', + '(?i)\\s*(num-results|num-entries|num-dbs|num-aliases|num-aliase|num-alias|num-alia|num-ali|now|not entered|normalize|next-value|new)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -157,7 +157,7 @@ const grammar = { patterns: [{include: '#function-arguments'}] }, 'abl-functions-O': { - begin: '(?i)\\s*(OPSYS|OS-DRIVES|OS-ERROR|OS-GETENV)\\s*(?=\\()', + begin: '(?i)\\s*(os-getenv|os-error|os-drives|os-drive|opsys)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -166,7 +166,7 @@ const grammar = { }, 'abl-functions-P': { begin: - '(?i)\\s*(PAGE-NUMBER|PAGE-SIZE|PDBNAME|proc-ha|proc-han|proc-hand|proc-handl|proc-handle|PROGRAM-NAME|PROGRESS|PROMSGS|PROPATH|provers|proversi|proversio|proversion)\\s*(?=\\()', + '(?i)\\s*(proversion|proversio|proversi|provers|propath|promsgs|progress|program-name|process-architecture|proc-status|proc-statu|proc-stat|proc-sta|proc-st|proc-handle|proc-handl|proc-hand|proc-han|proc-ha|pdbname|page-size|page-number|page-numbe|page-numb|page-num)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -174,7 +174,7 @@ const grammar = { patterns: [{include: '#function-arguments'}] }, 'abl-functions-Q': { - begin: '(?i)\\s*(QUERY-OFF-END|QUOTER)\\s*(?=\\()', + begin: '(?i)\\s*(quoter|query-off-end)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -183,7 +183,7 @@ const grammar = { }, 'abl-functions-R': { begin: - '(?i)\\s*(R-INDEX|RANDOM|RAW|RAW-TRANSFER|RECID|RECORD-LENGTH|REJECTED|REPLACE|RETRY|return|RETURN-VALUE|rgb-v|rgb-va|rgb-val|rgb-valu|rgb-value|RIGHT-TRIM|ROUND|ROW-STATE|ROWID)\\s*(?=\\()', + '(?i)\\s*(rowid|row-state|round|right-trim|rgb-value|rgb-valu|rgb-val|rgb-va|rgb-v|return-value|return|retry|replace|relation-fields|relation-field|relation-fiel|relation-fie|relation-fi|rejected|record-length|recid|raw|random|r-index)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -192,7 +192,7 @@ const grammar = { }, 'abl-functions-S': { begin: - '(?i)\\s*(SCREEN-LINES|SDBNAME|SEAL|SEARCH|SEEK|set-size|SET-DB-CLIENT|SET-EFFECTIVE-TENANT|set-attribute|set-attribute-node|set-rgb|set-byte-order|set-rgb-|set-rgb-v|set-rgb-va|set-rgb-val|set-rgb-valu|set-rgb-value|setuser|setuseri|setuserid|SHA1-DIGEST|SQRT|SSL-SERVER-NAME|string|subst|substi|substit|substitu|substitut|substitute|substr|substri|substrin|substring|SUPER)\\s*(?=\\()', + '(?i)\\s*(super|substring|substrin|substri|substr|substitute|substitut|substitu|substit|substi|subst|string|ssl-server-name|sqrt|skip|sha1-digest|setuserid|setuseri|setuser|set-size|set-effective-tenant|set-db-client|seek|search|sdbname|screen-lines)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -201,7 +201,7 @@ const grammar = { }, 'abl-functions-T': { begin: - '(?i)\\s*(TENANT-ID|TENANT-NAME|TENANT-NAME-TO-ID|TERMINAL|THIS-OBJECT|TIME|TIMEZONE|TODAY|TO-ROWID|TRANSACTION|TRIM|TRUNCATE|TYPE-OF)\\s*(?=\\()', + '(?i)\\s*(type-of|truncate|truncat|trunca|trunc|trim|transaction|today|to-rowid|timezone|time|this-object|terminal|tenant-name-to-id|tenant-name|tenant-id)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -209,7 +209,7 @@ const grammar = { patterns: [{include: '#function-arguments'}] }, 'abl-functions-U': { - begin: '(?i)\\s*(UNBOX|USERID)\\s*(?=\\()', + begin: '(?i)\\s*(userid|unbox)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -217,7 +217,7 @@ const grammar = { patterns: [{include: '#function-arguments'}] }, 'abl-functions-V': { - begin: '(?i)\\s*(VALID-EVENT|VALID-HANDLE|VALID-OBJECT|VALUE)\\s*(?=\\()', + begin: '(?i)\\s*(value|valid-object|valid-handle|valid-event)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -225,7 +225,8 @@ const grammar = { patterns: [{include: '#function-arguments'}] }, 'abl-functions-W': { - begin: '(?i)\\s*(WEEKDAY|WIDGET-HANDLE)\\s*(?=\\()', + begin: + '(?i)\\s*(widget-handle|widget-handl|widget-hand|widget-han|widget-ha|widget-h|weekday)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -233,7 +234,7 @@ const grammar = { patterns: [{include: '#function-arguments'}] }, 'abl-functions-Y': { - begin: '(?i)\\s*(YEAR)\\s*(?=\\()', + begin: '(?i)\\s*(year)\\s*(?=\\()', beginCaptures: {1: {name: 'support.function.abl'}}, end: '(\\))', endCaptures: {1: {name: 'meta.brace.round.js'}}, @@ -251,7 +252,7 @@ const grammar = { 'access-modifier': { captures: {1: {name: 'keyword.other.abl'}}, match: - '(?i)\\s*(package-private|private|package-protected|protected|public|static|override|abstract|final)\\s*' + '(?i)\\s*(package-private|private|package-protected|protected|public|static|override|abstract|final)\\b' }, 'analyze-suspend-resume': { begin: '(?i)(\\&analyze-suspend|\\&analyze-resume)\\s*', @@ -323,18 +324,21 @@ const grammar = { }, 'attribute-access': {begin: ':', end: '(?=:)|(?=\\s*)'}, 'block-label': { - captures: {2: {name: 'meta.block.label.abl'}}, - match: '(?i)^\\s*(([a-z][a-z0-9\\-\\_\\$]*):)\\s+' + captures: { + 2: {name: 'meta.block.label.abl'}, + 3: {name: 'punctuation.terminator.abl'} + }, + match: + '(?i)^\\s*(?!(transaction|no-lock|exclusive-lock|exclusive-loc|exclusive-lo|exclusive-l|share-lock|share-loc|share-lo|share-|share):)([a-z][a-z0-9\\-\\$\\#]*)(:)\\s' }, 'block-statement': { - begin: '(?i)(? -// and licensed `mit`. +// +// and licensed `apache-2.0`. // See for more info. /** * @import {Grammar} from '@wooorm/starry-night' @@ -11,240 +11,486 @@ const grammar = { extensions: ['.cairo'], names: ['cairo'], - patterns: [{include: '#directives'}, {include: '#statements'}], - repository: { - 'class-instance': { + patterns: [ + { + begin: '(<)(\\[)', + beginCaptures: { + 1: {name: 'punctuation.brackets.angle.cairo'}, + 2: {name: 'punctuation.brackets.square.cairo'} + }, + end: '>', + endCaptures: {0: {name: 'punctuation.brackets.angle.cairo'}}, patterns: [ - { - match: '[[:upper:]][_$[:alnum:]]+[[:lower:]]+[_$[:alnum:]]+', - name: 'support.class.cairo' - } + {include: '#block-comments'}, + {include: '#comments'}, + {include: '#gtypes'}, + {include: '#lvariables'}, + {include: '#punctuation'}, + {include: '#types'} ] }, - comment: { + { + captures: { + 1: {name: 'storage.type.cairo'}, + 2: {name: 'entity.name.module.cairo'} + }, + match: '(mod)\\s+([a-z][A-Za-z0-9_]*)' + }, + { + begin: '\\b(use)\\s', + beginCaptures: {1: {name: 'keyword.other.cairo'}}, + end: ';', + endCaptures: {0: {name: 'punctuation.semi.cairo'}}, + name: 'meta.use.cairo', patterns: [ - { - begin: '//', - beginCaptures: {0: {name: 'punctuation.definition.comment'}}, - end: '$', - name: 'comment.line.number-sign' - } + {include: '#block-comments'}, + {include: '#comments'}, + {include: '#keywords'}, + {include: '#namespaces'}, + {include: '#punctuation'}, + {include: '#types'}, + {include: '#lvariables'} ] }, - declaration: {patterns: [{include: '#import'}]}, - directives: { + {include: '#block-comments'}, + {include: '#comments'}, + {include: '#attributes'}, + {include: '#lvariables'}, + {include: '#constants'}, + {include: '#gtypes'}, + {include: '#functions'}, + {include: '#types'}, + {include: '#keywords'}, + {include: '#macros'}, + {include: '#namespaces'}, + {include: '#punctuation'}, + {include: '#strings'}, + {include: '#variables'} + ], + repository: { + attributes: { + begin: '(#)(\\!?)(\\[)', + beginCaptures: { + 1: {name: 'punctuation.definition.attribute.cairo'}, + 3: {name: 'punctuation.brackets.attribute.cairo'} + }, + end: '\\]', + endCaptures: {0: {name: 'punctuation.brackets.attribute.cairo'}}, + name: 'meta.attribute.cairo', patterns: [ - { - captures: {1: {name: 'keyword.directive.cairo'}}, - match: '(?|<|\\||&|\\?|\\^|~|\\*|\\+|\\-|\\/|\\%', - name: 'keyword.operator' + captures: {1: {name: 'punctuation.definition.comment.cairo'}}, + match: '(///).*$', + name: 'comment.line.documentation.cairo' }, { - match: '(?', name: 'keyword.function.return.cairo'} + {include: '#block-comments'}, + {include: '#comments'}, + {include: '#attributes'}, + {include: '#keywords'}, + {include: '#lvariables'}, + {include: '#constants'}, + {include: '#gtypes'}, + {include: '#functions'}, + {include: '#macros'}, + {include: '#namespaces'}, + {include: '#punctuation'}, + {include: '#strings'}, + {include: '#types'}, + {include: '#variables'} ] - } - ] - }, - 'function-implicit': { - patterns: [ + }, { - begin: '(?<=[a-zA-Z0-9])\\s*{', - end: '}', - patterns: [{include: '#parameters'}] + begin: '([A-Za-z0-9_]+)(?=::<.*>\\()', + beginCaptures: {1: {name: 'entity.name.function.cairo'}}, + end: '\\)', + endCaptures: {0: {name: 'punctuation.brackets.round.cairo'}}, + name: 'meta.function.call.cairo', + patterns: [ + {include: '#block-comments'}, + {include: '#comments'}, + {include: '#attributes'}, + {include: '#keywords'}, + {include: '#lvariables'}, + {include: '#constants'}, + {include: '#gtypes'}, + {include: '#functions'}, + {include: '#lifetimes'}, + {include: '#macros'}, + {include: '#namespaces'}, + {include: '#punctuation'}, + {include: '#strings'}, + {include: '#types'}, + {include: '#variables'} + ] } ] }, - 'function-params': { + gtypes: { patterns: [ - {begin: '\\(', end: '\\)', patterns: [{include: '#parameters'}]} + {match: '\\b(Some|None)\\b', name: 'entity.name.type.option.cairo'}, + {match: '\\b(Ok|Err)\\b', name: 'entity.name.type.result.cairo'} ] }, - identifiers: { + interpolations: { + captures: { + 1: {name: 'punctuation.definition.interpolation.cairo'}, + 2: {name: 'punctuation.definition.interpolation.cairo'} + }, + match: '({)[^"{}]*(})', + name: 'meta.interpolation.cairo' + }, + keywords: { patterns: [ { match: - '(?>|!)(?!=)', + name: 'keyword.operator.logical.cairo' + }, + {match: '&(?![&=])', name: 'keyword.operator.borrow.and.cairo'}, + { + match: '(\\+=|-=|\\*=|/=|%=|\\^=|&=|\\|=|<<=|>>=)', + name: 'keyword.operator.assignment.cairo' + }, + { + match: '(?])=(?!=|>)', + name: 'keyword.operator.assignment.equal.cairo' + }, + { + match: '(=(=)?(?!>)|!=|<=|(?=)', + name: 'keyword.operator.comparison.cairo' + }, + { + match: '(([+%]|(\\*(?!\\w)))(?!=))|(-(?!>))|(/(?!/))', + name: 'keyword.operator.math.cairo' + }, + { + captures: { + 1: {name: 'punctuation.brackets.round.cairo'}, + 2: {name: 'punctuation.brackets.square.cairo'}, + 3: {name: 'punctuation.brackets.curly.cairo'}, + 4: {name: 'keyword.operator.comparison.cairo'}, + 5: {name: 'punctuation.brackets.round.cairo'}, + 6: {name: 'punctuation.brackets.square.cairo'}, + 7: {name: 'punctuation.brackets.curly.cairo'} + }, + match: + '(?:\\b|(?:(\\))|(\\])|(\\})))[ \\t]+([<>])[ \\t]+(?:\\b|(?:(\\()|(\\[)|(\\{)))' + }, + {match: '::', name: 'keyword.operator.namespace.cairo'}, + { + captures: {1: {name: 'keyword.operator.desnap.cairo'}}, + match: '(\\*)(?=\\w+)' + }, + {match: '@', name: 'keyword.operator.snap.cairo'}, + {match: '\\.(?!\\.)', name: 'keyword.operator.access.dot.cairo'}, + {match: '\\.{2}(=|\\.)?', name: 'keyword.operator.range.cairo'}, + {match: ':(?!:)', name: 'keyword.operator.key-value.cairo'}, + {match: '->', name: 'keyword.operator.arrow.skinny.cairo'}, + {match: '=>', name: 'keyword.operator.arrow.fat.cairo'}, + {match: '\\$', name: 'keyword.operator.macro.dollar.cairo'}, + {match: '\\?', name: 'keyword.operator.question.cairo'} ] }, - parameters: { + lvariables: { + patterns: [{match: '\\bsuper\\b', name: 'variable.language.super.cairo'}] + }, + macros: { patterns: [ - {include: '#comment'}, - {include: '#punctuation-accessor'}, { captures: { - 1: {name: 'punctuation.separator'}, - 2: {name: 'support.type.cairo'} + 2: {name: 'entity.name.function.macro.cairo'}, + 3: {name: 'entity.name.type.macro.cairo'} }, - match: '(:)\\s*([_$[:alpha:]][_$[:alnum:]]+)' + match: '(([a-z_][A-Za-z0-9_]*!)|([A-Z_][A-Za-z0-9_]*!))', + name: 'meta.macro.cairo' } ] }, - 'punctuation-accessor': { + namespaces: { patterns: [ { captures: { - 1: {name: 'punctuation.separator.dot-accessor.cairo'}, - 2: {name: 'keyword.operator'} + 1: {name: 'entity.name.namespace.cairo'}, + 2: {name: 'keyword.operator.namespace.cairo'} }, - match: '(\\.)|(\\*)' + match: '(?]', name: 'punctuation.brackets.angle.cairo'} ] }, - storages: { + strings: { patterns: [ { - match: '\\b(let|const|local|struct|alloc_locals|tempvar)\\b', - name: 'storage.type.cairo' + begin: '(")', + beginCaptures: { + 1: {name: 'punctuation.definition.string.bytearray.cairo'} + }, + end: '"', + endCaptures: { + 0: {name: 'punctuation.definition.string.bytearray.cairo'} + }, + name: 'string.quoted.double.cairo', + patterns: [{include: '#escapes'}, {include: '#interpolations'}] + }, + { + begin: "(')", + beginCaptures: { + 1: {name: 'punctuation.definition.string.short.cairo'} + }, + end: "'", + endCaptures: {0: {name: 'punctuation.definition.string.short.cairo'}}, + name: 'string.quoted.single.cairo', + patterns: [{include: '#escapes'}, {include: '#interpolations'}] } ] }, - string: { + types: { patterns: [ { - begin: '"', + captures: {1: {name: 'entity.name.type.numeric.cairo'}}, + match: + '(?', + endCaptures: {0: {name: 'punctuation.brackets.angle.cairo'}}, + patterns: [ + {include: '#block-comments'}, + {include: '#comments'}, + {include: '#keywords'}, + {include: '#lvariables'}, + {include: '#punctuation'}, + {include: '#types'}, + {include: '#variables'} + ] }, + {match: '\\b(bool|never)\\b', name: 'entity.name.type.primitive.cairo'}, { - begin: "'", - beginCaptures: { - 0: {name: 'punctuation.definition.string.begin.cairo'} + captures: { + 1: {name: 'keyword.declaration.trait.cairo storage.type.cairo'}, + 2: {name: 'entity.name.type.trait.cairo'} }, - end: "'", - endCaptures: {0: {name: 'punctuation.definition.string.end.cairo'}}, - name: 'string.quoted.single.cairo' + match: '\\b(trait)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b' + }, + { + captures: { + 1: {name: 'keyword.declaration.struct.cairo storage.type.cairo'}, + 2: {name: 'entity.name.type.struct.cairo'} + }, + match: '\\b(struct)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b' + }, + { + captures: { + 1: {name: 'keyword.declaration.enum.cairo storage.type.cairo'}, + 2: {name: 'entity.name.type.enum.cairo'} + }, + match: '\\b(enum)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b' + }, + { + captures: { + 1: {name: 'keyword.declaration.type.cairo storage.type.cairo'}, + 2: {name: 'entity.name.type.declaration.cairo'} + }, + match: '\\b(type)\\s+(_?[A-Z][A-Za-z0-9_]*)\\b' + }, + { + match: '\\b_?[A-Z][A-Za-z0-9_]*\\b(?!!)', + name: 'entity.name.type.cairo' } ] }, - 'support-objects': {patterns: [{include: '#class-instance'}]} + variables: { + patterns: [ + { + match: '\\b(? +// and licensed `apache-2.0`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + dependencies: ['source.cairo'], + extensions: [], + names: ['cairo-zero'], + patterns: [ + { + begin: '\\b(if).*\\(', + beginCaptures: { + 1: {name: 'keyword.control.if'}, + 2: {name: 'entity.name.condition'} + }, + contentName: 'source.cairo', + end: '\\}', + endCaptures: {0: {name: 'keyword.control.end'}}, + name: 'meta.control.if', + patterns: [{include: 'source.cairo'}] + }, + { + begin: '\\b(with)\\s+(.+)\\s*\\{', + beginCaptures: { + 1: {name: 'keyword.control.with'}, + 2: {name: 'entity.name.identifiers'} + }, + contentName: 'source.cairo', + end: '\\}', + endCaptures: {0: {name: 'keyword.control.end'}}, + name: 'meta.control.with', + patterns: [{include: 'source.cairo'}] + }, + { + begin: '\\b(with_attr)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*[({]', + beginCaptures: { + 1: {name: 'keyword.control.with_attr'}, + 2: {name: 'entity.name.function'} + }, + contentName: 'source.cairo', + end: '\\}', + endCaptures: {0: {name: 'keyword.control.end'}}, + name: 'meta.control.with_attr', + patterns: [{include: 'source.cairo'}] + }, + {match: '\\belse\\b', name: 'keyword.control.else'}, + {match: '\\b(call|jmp|ret|abs|rel|if)\\b', name: 'keyword.other.opcode'}, + {match: '\\b(ap|fp)\\b', name: 'keyword.other.register'}, + { + match: + '\\b(const|let|local|tempvar|felt|as|from|import|static_assert|return|assert|cast|alloc_locals|with|with_attr|nondet|dw|codeoffset|new|using|and)\\b', + name: 'keyword.other.meta' + }, + {match: '\\b(SIZEOF_LOCALS|SIZE)\\b', name: 'markup.italic'}, + {match: '//[^\n]*\n', name: 'comment.line.sharp'}, + {match: '\\b[a-zA-Z_][a-zA-Z0-9_]*:\\s*$', name: 'entity.name.function'}, + { + begin: '\\b(func)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*[({]', + beginCaptures: { + 1: {name: 'storage.type.function.cairo'}, + 2: {name: 'entity.name.function'} + }, + contentName: 'source.cairo', + end: '\\}', + endCaptures: {0: {name: 'storage.type.function.cairo'}}, + name: 'meta.function.cairo', + patterns: [{include: 'source.cairo'}] + }, + { + begin: '\\b(struct|namespace)\\s+([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\{', + beginCaptures: { + 1: {name: 'storage.type.function.cairo'}, + 2: {name: 'entity.name.function'} + }, + contentName: 'source.cairo', + end: '\\}', + endCaptures: {0: {name: 'storage.type.function.cairo'}}, + name: 'meta.function.cairo', + patterns: [{include: 'source.cairo'}] + }, + {match: '\\b[+-]?[0-9]+\\b', name: 'constant.numeric.decimal'}, + {match: '\\b[+-]?0x[0-9a-fA-F]+\\b', name: 'constant.numeric.hexadecimal'}, + {match: "'[^']*'", name: 'string.quoted.single'}, + {match: '"[^"]*"', name: 'string.quoted.double'}, + { + begin: '%{', + beginCaptures: {0: {name: 'punctuation.section.embedded.begin.python'}}, + contentName: 'source.python', + end: '%}', + endCaptures: { + 0: {name: 'punctuation.section.embedded.end.python'}, + 1: {name: 'source.python'} + }, + name: 'meta.embedded.block.python', + patterns: [{include: 'source.python'}] + } + ], + scopeName: 'source.cairo0' +} + +export default grammar diff --git a/lang/source.clar.js b/lang/source.clar.js index 1134a9f..1429efa 100644 --- a/lang/source.clar.js +++ b/lang/source.clar.js @@ -25,7 +25,7 @@ const grammar = { repository: { 'built-in-func': { begin: - '(?x) (\\() \\s* (\\-|\\+|<\\=|>\\=|<|>|\\*|/|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+', + '(?x) (\\() \\s* (\\-|\\+|<\\=|>\\=|<|>|\\*|/|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+', beginCaptures: { 1: {name: 'punctuation.built-in-function.start.clarity'}, 2: {name: 'keyword.declaration.built-in-function.clarity'} @@ -304,7 +304,7 @@ const grammar = { }, keyword: { match: - '(? -// and licensed permissive. +// and licensed `cc0-1.0`. // See for more info. /** * @import {Grammar} from '@wooorm/starry-night' diff --git a/lang/source.curlrc.js b/lang/source.curlrc.js index 32ba69f..7b562b8 100644 --- a/lang/source.curlrc.js +++ b/lang/source.curlrc.js @@ -70,12 +70,12 @@ const grammar = { 2: {name: 'punctuation.definition.dash.long.option.curlrc'} }, match: - '(?x)\n(?:\\G|^|(?<=[ \\t])) \\s*\n(\n\t(--)?\n\t(?\n\t\tanyauth\n\t|\tappend\n\t|\tbasic\n\t|\tcert-status\n\t|\tcompressed-ssh\n\t|\tcompressed\n\t|\tcreate-dirs\n\t|\tcrlf\n\t|\tdigest\n\t|\tdisable-eprt\n\t|\tdisable-epsv\n\t|\tdisable\n\t|\tdisallow-username-in-url\n\t|\tdoh-cert-status\n\t|\tdoh-insecure\n\t|\tfail-early\n\t|\tfail-with-body\n\t|\tfail\n\t|\tfalse-start\n\t|\tform-escape\n\t|\tftp-create-dirs\n\t|\tftp-pasv\n\t|\tftp-pret\n\t|\tftp-skip-pasv-ip\n\t|\tftp-ssl-ccc\n\t|\tftp-ssl-control\n\t|\tget\n\t|\tgloboff\n\t|\thaproxy-protocol\n\t|\thead\n\t|\thttp0.9\n\t|\thttp1.0\n\t|\thttp1.1\n\t|\thttp2-prior-knowledge\n\t|\thttp2\n\t|\thttp3-only\n\t|\thttp3\n\t|\tignore-content-length\n\t|\tinclude\n\t|\tinsecure\n\t|\tipv4\n\t|\tipv6\n\t|\tjunk-session-cookies\n\t|\tlist-only\n\t|\tlocation-trusted\n\t|\tlocation\n\t|\tmail-rcpt-allowfails\n\t|\tmanual\n\t|\tmetalink\n\t|\tnegotiate\n\t|\tnetrc-optional\n\t|\tnetrc\n\t|\tnext\n\t|\tno-alpn\n\t|\tno-buffer\n\t|\tno-clobber\n\t|\tno-keepalive\n\t|\tno-npn\n\t|\tno-progress-meter\n\t|\tno-sessionid\n\t|\tntlm-wb\n\t|\tntlm\n\t|\tparallel-immediate\n\t|\tparallel\n\t|\tpath-as-is\n\t|\tpost301\n\t|\tpost302\n\t|\tpost303\n\t|\tprogress-bar\n\t|\tproxy-anyauth\n\t|\tproxy-basic\n\t|\tproxy-digest\n\t|\tproxy-insecure\n\t|\tproxy-negotiate\n\t|\tproxy-ntlm\n\t|\tproxy-ssl-allow-beast\n\t|\tproxy-ssl-auto-client-cert\n\t|\tproxy-tlsv1\n\t|\tproxytunnel\n\t|\traw\n\t|\tremote-header-name\n\t|\tremote-name-all\n\t|\tremote-name\n\t|\tremote-time\n\t|\tremove-on-error\n\t|\tretry-all-errors\n\t|\tretry-connrefused\n\t|\tsasl-ir\n\t|\tshow-error\n\t|\tsilent\n\t|\tsocks5-basic\n\t|\tsocks5-gssapi-nec\n\t|\tsocks5-gssapi\n\t|\tssl-allow-beast\n\t|\tssl-auto-client-cert\n\t|\tssl-no-revoke\n\t|\tssl-reqd\n\t|\tssl-revoke-best-effort\n\t|\tsslv2\n\t|\tsslv3\n\t|\tssl\n\t|\tstyled-output\n\t|\tsuppress-connect-headers\n\t|\ttcp-fastopen\n\t|\ttcp-nodelay\n\t|\ttftp-no-options\n\t|\ttlsv1.0\n\t|\ttlsv1.1\n\t|\ttlsv1.2\n\t|\ttlsv1.3\n\t|\ttlsv1\n\t|\ttr-encoding\n\t|\ttrace-time\n\t|\tuse-ascii\n\t|\tverbose\n\t|\tversion\n\t|\txattr\n\t)\n)\n(?=\\s|$)', + '(?x)\n(?:\\G|^|(?<=[ \\t])) \\s*\n(\n\t(--)?\n\t(?\n\t\tanyauth\n\t|\tappend\n\t|\tbasic\n\t|\tca-native\n\t|\tcert-status\n\t|\tcompressed-ssh\n\t|\tcompressed\n\t|\tcreate-dirs\n\t|\tcrlf\n\t|\tdigest\n\t|\tdisable-eprt\n\t|\tdisable-epsv\n\t|\tdisable\n\t|\tdisallow-username-in-url\n\t|\tdoh-cert-status\n\t|\tdoh-insecure\n\t|\tdump-ca-embed\n\t|\tfail-early\n\t|\tfail-with-body\n\t|\tfail\n\t|\tfalse-start\n\t|\tform-escape\n\t|\tftp-create-dirs\n\t|\tftp-pasv\n\t|\tftp-pret\n\t|\tftp-skip-pasv-ip\n\t|\tftp-ssl-ccc\n\t|\tftp-ssl-control\n\t|\tget\n\t|\tgloboff\n\t|\thaproxy-protocol\n\t|\thead\n\t|\thttp0.9\n\t|\thttp1.0\n\t|\thttp1.1\n\t|\thttp2-prior-knowledge\n\t|\thttp2\n\t|\thttp3-only\n\t|\thttp3\n\t|\tignore-content-length\n\t|\tinclude\n\t|\tinsecure\n\t|\tipv4\n\t|\tipv6\n\t|\tjunk-session-cookies\n\t|\tlist-only\n\t|\tlocation-trusted\n\t|\tlocation\n\t|\tmail-rcpt-allowfails\n\t|\tmanual\n\t|\tmetalink\n\t|\tnegotiate\n\t|\tnetrc-optional\n\t|\tnetrc\n\t|\tnext\n\t|\tno-alpn\n\t|\tno-buffer\n\t|\tno-clobber\n\t|\tno-keepalive\n\t|\tno-npn\n\t|\tno-progress-meter\n\t|\tno-sessionid\n\t|\tmptcp\n\t|\tntlm-wb\n\t|\tntlm\n\t|\tparallel-immediate\n\t|\tparallel\n\t|\tpath-as-is\n\t|\tpost301\n\t|\tpost302\n\t|\tpost303\n\t|\tprogress-bar\n\t|\tproxy-anyauth\n\t|\tproxy-basic\n\t|\tproxy-ca-native\n\t|\tproxy-digest\n\t|\tproxy-http2\n\t|\tproxy-insecure\n\t|\tproxy-negotiate\n\t|\tproxy-ntlm\n\t|\tproxy-ssl-allow-beast\n\t|\tproxy-ssl-auto-client-cert\n\t|\tproxy-tlsv1\n\t|\tproxytunnel\n\t|\traw\n\t|\tremote-header-name\n\t|\tremote-name-all\n\t|\tremote-name\n\t|\tremote-time\n\t|\tremove-on-error\n\t|\tretry-all-errors\n\t|\tretry-connrefused\n\t|\tsasl-ir\n\t|\tshow-error\n\t|\tshow-headers\n\t|\tsilent\n\t|\tskip-existing\n\t|\tsocks5-basic\n\t|\tsocks5-gssapi-nec\n\t|\tsocks5-gssapi\n\t|\tssl-allow-beast\n\t|\tssl-auto-client-cert\n\t|\tssl-no-revoke\n\t|\tssl-reqd\n\t|\tssl-revoke-best-effort\n\t|\tsslv2\n\t|\tsslv3\n\t|\tssl\n\t|\tstyled-output\n\t|\tsuppress-connect-headers\n\t|\ttcp-fastopen\n\t|\ttcp-nodelay\n\t|\ttftp-no-options\n\t|\ttlsv1.0\n\t|\ttlsv1.1\n\t|\ttlsv1.2\n\t|\ttlsv1.3\n\t|\ttlsv1\n\t|\ttr-encoding\n\t|\ttrace-ids\n\t|\ttrace-time\n\t|\tuse-ascii\n\t|\tverbose\n\t|\tversion\n\t|\txattr\n\t)\n)\n(?=\\s|$)', name: 'meta.option.long.curlrc' }, { begin: - '(?x) (?:\\G|^|(?<=[ \\t]))\n(?!\\s*--\\w[-\\w]*\\s*[=:]) \\s*\n(\n\t(--)?\n\t(?\n\t\tdns-ipv4-addr\n\t|\tdns-ipv6-addr\n\t|\tdns-servers\n\t|\tdoh-url\n\t|\tmail-auth\n\t|\tmail-from\n\t|\tmail-rcpt\n\t|\tnoproxy\n\t|\treferer\n\t|\turl\n\t)\n)\n(?:\\s*(=|:)|(?=\\s|$))', + '(?x) (?:\\G|^|(?<=[ \\t]))\n(?!\\s*--\\w[-\\w]*\\s*[=:]) \\s*\n(\n\t(--)?\n\t(?\n\t\tdns-ipv4-addr\n\t|\tdns-ipv6-addr\n\t|\tdns-servers\n\t|\tdoh-url\n\t|\thaproxy-clientip\n\t|\tipfs-gateway\n\t|\tmail-auth\n\t|\tmail-from\n\t|\tmail-rcpt\n\t|\tnoproxy\n\t|\treferer\n\t|\turl\n\t)\n)\n(?:\\s*(=|:)|(?=\\s|$))', beginCaptures: { 1: {name: 'entity.long.option.name.curlrc'}, 2: {name: 'punctuation.definition.dash.long.option.curlrc'}, @@ -111,7 +111,7 @@ const grammar = { }, { begin: - '(?x) (?:\\G|^|(?<=[ \\t]))\n(?!\\s*--\\w[-\\w]*\\s*[=:]) \\s*\n(\n\t(--)?\n\t(?\n\t\tcookie\n\t|\tform-string\n\t|\tform\n\t|\ttelnet-option\n\t)\n)\n(?:\\s*(=|:)|(?=\\s|$))', + '(?x) (?:\\G|^|(?<=[ \\t]))\n(?!\\s*--\\w[-\\w]*\\s*[=:]) \\s*\n(\n\t(--)?\n\t(?\n\t\tcookie\n\t|\tform-string\n\t|\tform\n\t|\ttelnet-option\n\t|\tvariable\n\t)\n)\n(?:\\s*(=|:)|(?=\\s|$))', beginCaptures: { 1: {name: 'entity.long.option.name.curlrc'}, 2: {name: 'punctuation.definition.dash.long.option.curlrc'}, @@ -231,7 +231,7 @@ const grammar = { }, { begin: - '(?x) (?:\\G|^|(?<=[ \\t]))\n(?!\\s*--\\w[-\\w]*\\s*[=:](?=\\s)) \\s*\n(\n\t(--)?\n\t(?\n\t\tabstract-unix-socket\n\t|\talt-svc\n\t|\tcacert\n\t|\tcapath\n\t|\tcert-type\n\t|\tciphers\n\t|\tconfig\n\t|\tcookie-jar\n\t|\tcrlfile\n\t|\tcurves\n\t|\tdata-ascii\n\t|\tdata-binary\n\t|\tdata-raw\n\t|\tdata-urlencode\n\t|\tdata\n\t|\tdelegation\n\t|\tdns-interface\n\t|\tdump-header\n\t|\tegd-file\n\t|\tengine\n\t|\tetag-compare\n\t|\tetag-save\n\t|\tftp-account\n\t|\tftp-alternative-to-user\n\t|\tftp-method\n\t|\tftp-ssl-ccc-mode\n\t|\thappy-eyeballs-timeout-ms\n\t|\thelp\n\t|\thostpubsha256\n\t|\thsts\n\t|\tinterface\n\t|\tjson\n\t|\tkey-type\n\t|\tkey\n\t|\tkrb\n\t|\tlibcurl\n\t|\tlogin-options\n\t|\tnetrc-file\n\t|\toauth2-bearer\n\t|\toutput-dir\n\t|\toutput\n\t|\tpass\n\t|\tpinnedpubkey\n\t|\tproxy-cacert\n\t|\tproxy-capath\n\t|\tproxy-cert-type\n\t|\tproxy-ciphers\n\t|\tproxy-crlfile\n\t|\tproxy-key-type\n\t|\tproxy-key\n\t|\tproxy-pass\n\t|\tproxy-pinnedpubkey\n\t|\tproxy-service-name\n\t|\tproxy-tls13-ciphers\n\t|\tproxy-tlsauthtype\n\t|\tproxy-tlspassword\n\t|\tproxy-tlsuser\n\t|\tpubkey\n\t|\tquote\n\t|\trandom-file\n\t|\trequest-target\n\t|\trequest\n\t|\tsasl-authzid\n\t|\tservice-name\n\t|\tsocks5-gssapi-service\n\t|\tstderr\n\t|\ttls-max\n\t|\ttls13-ciphers\n\t|\ttlsauthtype\n\t|\ttlspassword\n\t|\ttlsuser\n\t|\ttrace-ascii\n\t|\ttrace\n\t|\tunix-socket\n\t|\tupload-file\n\t|\turl-query\n\t|\tuser-agent\n\t|\twrite-out\n\t)\n)\n(?:\\s*(=|:)|(?=\\s|$))', + '(?x) (?:\\G|^|(?<=[ \\t]))\n(?!\\s*--\\w[-\\w]*\\s*[=:](?=\\s)) \\s*\n(\n\t(--)?\n\t(?\n\t\tabstract-unix-socket\n\t|\talt-svc\n\t|\tcacert\n\t|\tcapath\n\t|\tcert-type\n\t|\tciphers\n\t|\tconfig\n\t|\tcookie-jar\n\t|\tcrlfile\n\t|\tcurves\n\t|\tdata-ascii\n\t|\tdata-binary\n\t|\tdata-raw\n\t|\tdata-urlencode\n\t|\tdata\n\t|\tdelegation\n\t|\tdns-interface\n\t|\tdump-header\n\t|\tech\n\t|\tegd-file\n\t|\tengine\n\t|\tetag-compare\n\t|\tetag-save\n\t|\tftp-account\n\t|\tftp-alternative-to-user\n\t|\tftp-method\n\t|\tftp-ssl-ccc-mode\n\t|\thappy-eyeballs-timeout-ms\n\t|\thelp\n\t|\thostpubsha256\n\t|\thsts\n\t|\tinterface\n\t|\tjson\n\t|\tkey-type\n\t|\tkey\n\t|\tkrb\n\t|\tlibcurl\n\t|\tlogin-options\n\t|\tnetrc-file\n\t|\toauth2-bearer\n\t|\toutput-dir\n\t|\toutput\n\t|\tpass\n\t|\tpinnedpubkey\n\t|\tproxy-cacert\n\t|\tproxy-capath\n\t|\tproxy-cert-type\n\t|\tproxy-ciphers\n\t|\tproxy-crlfile\n\t|\tproxy-key-type\n\t|\tproxy-key\n\t|\tproxy-pass\n\t|\tproxy-pinnedpubkey\n\t|\tproxy-service-name\n\t|\tproxy-tls13-ciphers\n\t|\tproxy-tlsauthtype\n\t|\tproxy-tlspassword\n\t|\tproxy-tlsuser\n\t|\tpubkey\n\t|\tquote\n\t|\trandom-file\n\t|\trequest-target\n\t|\trequest\n\t|\tsasl-authzid\n\t|\tservice-name\n\t|\tsocks5-gssapi-service\n\t|\tstderr\n\t|\ttls-max\n\t|\ttls13-ciphers\n\t|\ttlsauthtype\n\t|\ttlspassword\n\t|\ttlsuser\n\t|\ttrace-ascii\n\t|\ttrace-config\n\t|\ttrace\n\t|\tunix-socket\n\t|\tupload-file\n\t|\turl-query\n\t|\tuser-agent\n\t|\twrite-out\n\t)\n)\n(?:\\s*(=|:)|(?=\\s|$))', beginCaptures: { 1: {name: 'entity.long.option.name.curlrc'}, 2: {name: 'punctuation.definition.dash.long.option.curlrc'}, @@ -253,7 +253,7 @@ const grammar = { }, { begin: - '(?x) (?:\\G|^|(?<=[ \\t]))\n(?!\\s*--\\w[-\\w]*\\s*[=:])\n\\s*\n(\n\t(--)?\n\t(?\n\t\tconnect-timeout\n\t|\tcontinue-at\n\t|\tcreate-file-mode\n\t|\texpect100-timeout\n\t|\tkeepalive-time\n\t|\tlimit-rate\n\t|\tmax-filesize\n\t|\tmax-redirs\n\t|\tmax-time\n\t|\tparallel-max\n\t|\trate\n\t|\tretry-delay\n\t|\tretry-max-time\n\t|\tretry\n\t|\tspeed-limit\n\t|\tspeed-time\n\t|\ttftp-blksize\n\t|\ttime-cond\n\t)\n) (?:\\s*(=|:)|(?=\\s|$))', + '(?x) (?:\\G|^|(?<=[ \\t]))\n(?!\\s*--\\w[-\\w]*\\s*[=:])\n\\s*\n(\n\t(--)?\n\t(?\n\t\tconnect-timeout\n\t|\tcontinue-at\n\t|\tcreate-file-mode\n\t|\texpect100-timeout\n\t|\tip-tos\n\t|\tkeepalive-cnt\n\t|\tkeepalive-time\n\t|\tlimit-rate\n\t|\tmax-filesize\n\t|\tmax-redirs\n\t|\tmax-time\n\t|\tparallel-max\n\t|\trate\n\t|\tretry-delay\n\t|\tretry-max-time\n\t|\tretry\n\t|\tspeed-limit\n\t|\tspeed-time\n\t|\ttftp-blksize\n\t|\ttime-cond\n\t|\tvlan-priority\n\t)\n) (?:\\s*(=|:)|(?=\\s|$))', beginCaptures: { 1: {name: 'entity.long.option.name.curlrc'}, 2: {name: 'punctuation.definition.dash.long.option.curlrc'}, diff --git a/lang/source.curry.js b/lang/source.curry.js index 334d88d..62deb74 100644 --- a/lang/source.curry.js +++ b/lang/source.curry.js @@ -75,7 +75,7 @@ const grammar = { captures: {0: {name: 'punctuation.comment.curry'}}, end: '(? +// and licensed `bsd-3-clause`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + extensions: ['.cylc'], + names: ['cylc'], + patterns: [ + {include: '#comments'}, + {include: '#jinja2'}, + {include: '#graphSections'}, + {include: '#headers'}, + {include: '#settings'}, + {include: '#includeFiles'}, + {include: '#keywords'}, + {include: '#strings'} + ], + repository: { + comments: { + patterns: [ + { + begin: '#', + beginCaptures: {0: {name: 'punctuation.definition.comment.cylc'}}, + end: '(?=[\\n\\r])', + name: 'comment.line.cylc', + patterns: [{include: '#jinja2'}] + } + ] + }, + graphSections: { + patterns: [ + { + begin: '\\b(graph)[\\t ]*(=)[\\t ]*', + beginCaptures: { + 1: {name: 'keyword.graph.cylc'}, + 2: {name: 'keyword.operator.assignment.cylc'} + }, + end: '(?=[#\\n\\r])', + patterns: [ + {include: '#graphStrings'}, + { + captures: {1: {name: 'invalid.illegal.string.cylc'}}, + match: '(?:^|(?<="))[\\t ]*+([^#\\n\\r]+)' + } + ] + }, + { + begin: '\\[{2}[\\t ]*graph[\\t ]*\\]{2}', + beginCaptures: {0: {patterns: [{include: '#headers'}]}}, + contentName: 'meta.graph-section.cylc', + end: '(?=^[\\t ]*\\[)', + patterns: [ + {include: '#comments'}, + { + begin: '(\\S[^=#]*)(=)[\\t ]*', + beginCaptures: { + 1: { + patterns: [ + {include: '#jinja2'}, + { + match: '[\\w\\+\\^\\$][\\w\\+\\-\\^\\$\\/\\t ,:]*', + name: 'keyword.graph.cylc' + } + ] + }, + 2: {name: 'keyword.operator.assignment.cylc'} + }, + end: '(?=[#\\n\\r])', + patterns: [ + {include: '#graphStrings'}, + { + captures: {1: {name: 'invalid.illegal.string.cylc'}}, + match: '(?:^|(?<="))[\\t ]*+([^#\\n\\r]+)' + } + ] + } + ] + } + ] + }, + graphStrings: { + patterns: [ + { + begin: '\\G("{3})', + beginCaptures: { + 0: {name: 'string.quoted.triple.cylc'}, + 1: {name: 'punctuation.definition.string.begin.cylc'} + }, + end: '("{3})', + endCaptures: { + 0: {name: 'string.quoted.triple.cylc'}, + 1: {name: 'punctuation.definition.string.end.cylc'} + }, + name: 'meta.graph-syntax.quoted.triple.cylc', + patterns: [{include: '#graphSyntax'}] + }, + { + begin: '\\G(")', + beginCaptures: { + 0: {name: 'string.quoted.double.cylc'}, + 1: {name: 'punctuation.definition.string.begin.cylc'} + }, + end: '(["\\n\\r])', + endCaptures: { + 0: {name: 'string.quoted.double.cylc'}, + 1: {name: 'punctuation.definition.string.end.cylc'} + }, + name: 'meta.graph-syntax.quoted.double.cylc', + patterns: [{include: '#graphSyntax'}] + }, + { + captures: {0: {patterns: [{include: '#graphSyntax'}]}}, + match: '\\G[^#\\n\\r"]+', + name: 'meta.graph-syntax.unquoted.cylc' + } + ] + }, + graphSyntax: { + patterns: [ + {include: '#comments'}, + {include: '#parameterizations'}, + {include: '#jinja2'}, + { + captures: { + 1: {name: 'meta.variable.task.cylc'}, + 2: {name: 'meta.annotation.inter-cycle.cylc'}, + 3: {name: 'punctuation.section.brackets.begin.cylc'}, + 4: { + name: 'meta.annotation.inter-cycle.cylc', + patterns: [ + {include: '#jinja2'}, + {include: '#intervals'}, + {include: '#isodatetimes'}, + { + captures: {0: {name: 'constant.language.cycle-point.cylc'}}, + match: '\\^' + }, + {match: '[\\+\\-]', name: 'keyword.operator.arithmetic.cylc'}, + { + match: '\\b\\d+\\b', + name: 'constant.numeric.integer-point.cylc' + } + ] + }, + 5: {name: 'punctuation.section.brackets.end.cylc'}, + 6: {name: 'meta.annotation.qualifier.cylc'}, + 7: {name: 'punctuation.definition.annotation.cylc'}, + 8: {name: 'variable.annotation.cylc'}, + 9: {name: 'keyword.other.optional-output.cylc'} + }, + match: + '(\\b\\w[\\w\\+\\-@%]*)((\\[)([^\\]]+)(\\]))?((:)([\\w\\-]+))?\\s*(\\?(?![:\\w]))?' + }, + {match: '=>', name: 'keyword.control.trigger.cylc'}, + {match: '[\\|&]', name: 'keyword.other.logical.cylc'}, + { + begin: '\\(', + beginCaptures: {0: {name: 'punctuation.section.parens.begin.cylc'}}, + end: '[\\)\\n\\r]', + endCaptures: {0: {name: 'punctuation.section.parens.end.cylc'}}, + name: 'meta.parens.cylc', + patterns: [{include: '#graphSyntax'}] + }, + { + captures: { + 1: {name: 'keyword.other.suicide.cylc'}, + 2: {name: 'meta.variable.task.cylc'} + }, + match: '(?<=^|[\\s&>])(!)(\\b\\w[\\w\\+\\-@%]*)', + name: 'meta.variable.suicide.cylc' + }, + { + captures: {1: {name: 'punctuation.definition.variable.cylc'}}, + match: '(@)[\\w\\-]+', + name: 'variable.other.xtrigger.cylc' + }, + {match: '\\\\', name: 'constant.character.escape.continuation.cylc'} + ] + }, + headers: { + patterns: [ + { + captures: { + 1: {name: 'punctuation.definition.tag.begin.cylc'}, + 2: { + name: 'entity.name.tag.cylc', + patterns: [{include: '#parameterizations'}, {include: '#jinja2'}] + }, + 3: {name: 'punctuation.definition.tag.end.cylc'} + }, + match: '(\\[+)([^\\[\\]]+?)(\\]+)', + name: 'meta.section.cylc' + } + ] + }, + includeFiles: { + patterns: [ + { + captures: { + 1: {name: 'keyword.control.include.cylc'}, + 2: { + name: 'string.cylc', + patterns: [{include: '#comments'}, {include: '#jinja2'}] + } + }, + match: '(%include)[\\t ]*(.*)', + name: 'meta.include.cylc' + } + ] + }, + intervals: { + patterns: [ + {match: '\\bP\\d+[HS]', name: 'invalid.illegal.interval.cylc'}, + { + captures: {1: {name: 'punctuation.definition.period.cylc'}}, + match: '\\b(P)\\d+\\b', + name: 'constant.numeric.interval.integer.cylc' + }, + { + captures: { + 1: {name: 'punctuation.definition.period.cylc'}, + 2: {name: 'punctuation.definition.week.cylc'} + }, + match: '\\b(P)\\d+(W)\\b', + name: 'constant.numeric.interval.iso.cylc' + }, + { + captures: { + 1: {name: 'punctuation.definition.period.cylc'}, + 2: {name: 'punctuation.definition.year.cylc'}, + 3: {name: 'punctuation.definition.month.cylc'}, + 4: {name: 'punctuation.definition.day.cylc'}, + 5: {name: 'punctuation.definition.time.cylc'}, + 6: {name: 'punctuation.definition.hour.cylc'}, + 7: {name: 'punctuation.definition.min.cylc'}, + 8: {name: 'punctuation.definition.sec.cylc'} + }, + match: + '\\b(P(?=(?:\\d|T\\d)))(?:\\d+(Y))?(?:\\d+(M))?(?:\\d+(D))?(?:(T)(?:\\d+(H))?(?:\\d+(M))?(?:\\d+(S))?)?\\b', + name: 'constant.numeric.interval.iso.cylc' + } + ] + }, + isodatetimes: { + patterns: [ + { + match: '\\b\\d{3,7}T\\d{2,}Z?\\b', + name: 'invalid.illegal.isodatetime.cylc' + }, + { + match: '\\b(\\d{4})(?:(\\-)(\\d{2}))?(?:(\\-)(\\d{2}))?T\\d{3,}\\b', + name: 'invalid.illegal.isodatetime.cylc' + }, + { + match: + '\\b(\\d{4})(\\d{2})?(\\d{2})?T\\d{2,}(?:[\\+\\-]\\d+)?\\:\\d*\\b', + name: 'invalid.illegal.isodatetime.cylc' + }, + { + captures: { + 1: {name: 'constant.numeric.year.cylc'}, + 10: {name: 'punctuation.separator.time.cylc'}, + 11: {name: 'constant.numeric.sec.cylc'}, + 12: {name: 'constant.numeric.timezone.long.cylc'}, + 13: {name: 'punctuation.definition.timezone.cylc'}, + 14: {name: 'punctuation.definition.timezone.cylc'}, + 15: {name: 'constant.numeric.hour.cylc'}, + 16: {name: 'punctuation.separator.time.cylc'}, + 17: {name: 'constant.numeric.min.cylc'}, + 2: {name: 'punctuation.separator.date.cylc'}, + 3: {name: 'constant.numeric.month.cylc'}, + 4: {name: 'punctuation.separator.date.cylc'}, + 5: {name: 'constant.numeric.day.cylc'}, + 6: {name: 'punctuation.definition.time.cylc'}, + 7: {name: 'constant.numeric.hour.cylc'}, + 8: {name: 'punctuation.separator.time.cylc'}, + 9: {name: 'constant.numeric.min.cylc'} + }, + match: + '\\b(\\d{4})(?:(\\-)(\\d{2}))?(?:(\\-)(\\d{2}))?(?:(T)(\\d{2})(?:(:)(\\d{2}))?(?:(:)(\\d{2}))?((Z)|(?:([\\+\\-])(\\d{2})(?:(\\:)(\\d{2}))?))?)?\\b', + name: 'constant.numeric.isodatetime.long.cylc' + }, + { + captures: { + 1: {name: 'constant.numeric.year.cylc'}, + 10: {name: 'punctuation.definition.timezone.cylc'}, + 11: {name: 'constant.numeric.hour.cylc'}, + 12: {name: 'constant.numeric.min.cylc'}, + 2: {name: 'constant.numeric.month.cylc'}, + 3: {name: 'constant.numeric.day.cylc'}, + 4: {name: 'punctuation.definition.time.cylc'}, + 5: {name: 'constant.numeric.hour.cylc'}, + 6: {name: 'constant.numeric.min.cylc'}, + 7: {name: 'constant.numeric.sec.cylc'}, + 8: {name: 'constant.numeric.isotimezone.short.cylc'}, + 9: {name: 'punctuation.definition.timezone.cylc'} + }, + match: + '\\b(\\d{4})(\\d{2})?(\\d{2})?(?:(T)(\\d{2})(\\d{2})?(\\d{2})?((Z)|(?:([\\+\\-])(\\d{2})(\\d{2})?))?)?\\b', + name: 'constant.numeric.isodatetime.short.cylc' + } + ] + }, + jinja2: { + patterns: [ + { + begin: '(?={%)', + contentName: 'source.jinja', + end: '(?<=%})', + name: 'meta.embedded.block.jinja', + patterns: [ + { + match: '\\G{%[\\+\\-]?', + name: 'punctuation.definition.template-expression.begin.jinja' + }, + { + match: '\\-?%}', + name: 'punctuation.definition.template-expression.end.jinja' + } + ] + }, + { + begin: '(?={{)', + contentName: 'source.jinja', + end: '(?<=}})', + name: 'meta.embedded.block.jinja', + patterns: [ + { + match: '\\G{{', + name: 'punctuation.definition.template-expression.begin.jinja' + }, + { + match: '}}', + name: 'punctuation.definition.template-expression.end.jinja' + } + ] + }, + { + begin: '{#', + beginCaptures: { + 0: {name: 'punctuation.definition.comment.begin.jinja'} + }, + end: '#}', + endCaptures: {0: {name: 'punctuation.definition.comment.end.jinja'}}, + name: 'comment.block.jinja' + } + ] + }, + keywords: { + patterns: [ + {match: '\\b(if|for|while|return)\\b', name: 'keyword.control.cylc'} + ] + }, + parameterizations: { + patterns: [ + { + begin: '<', + beginCaptures: { + 0: {name: 'punctuation.definition.annotation.begin.cylc'} + }, + end: '(>)((\\[)([^\\]]+)(\\]))?((:)([\\w\\-]+))?\\s*(\\?(?![:\\w]))?', + endCaptures: { + 1: {name: 'punctuation.definition.annotation.end.cylc'}, + 2: {name: 'meta.annotation.inter-cycle.cylc'}, + 3: {name: 'punctuation.section.brackets.begin.cylc'}, + 4: { + name: 'meta.annotation.inter-cycle.cylc', + patterns: [ + {include: '#jinja2'}, + {include: '#intervals'}, + {include: '#isodatetimes'}, + { + captures: {0: {name: 'constant.language.cycle-point.cylc'}}, + match: '\\^' + }, + {match: '[\\+\\-]', name: 'keyword.operator.arithmetic.cylc'}, + { + match: '\\b\\d+\\b', + name: 'constant.numeric.integer-point.cylc' + } + ] + }, + 5: {name: 'punctuation.section.brackets.end.cylc'}, + 6: {name: 'meta.annotation.qualifier.cylc'}, + 7: {name: 'punctuation.definition.annotation.cylc'}, + 8: {name: 'variable.annotation.cylc'}, + 9: {name: 'keyword.other.optional-output.cylc'} + }, + name: 'meta.annotation.parameterization.cylc', + patterns: [ + {include: '#jinja2'}, + { + name: 'meta.polling.cylc', + patterns: [ + { + captures: {1: {name: 'entity.name.namespace.suite.cylc'}}, + match: '([^\\s<>]+)(?=::)' + }, + {match: '(?<=\\S)::(?=\\S)', name: 'punctuation.accessor.cylc'}, + { + captures: {1: {name: 'meta.variable.task.cylc'}}, + match: '(?<=::)(\\b\\w[\\w\\+\\-@%]*)' + }, + { + captures: { + 1: {name: 'meta.annotation.qualifier.cylc'}, + 2: {name: 'punctuation.definition.annotation.cylc'}, + 3: {name: 'variable.annotation.cylc'} + }, + match: '(? +// and licensed `mit`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + extensions: [], + names: ['dune'], + patterns: [ + {include: '#comments'}, + { + begin: + '\\(\\s*(lang|using|library|rule|executable|executables|rule|ocamllex|ocamlyacc|menhir|install|alias|copy_files|copy_files#|jbuild_version|include)\\s', + beginCaptures: {1: {name: 'meta.class.stanza.dune'}}, + end: '\\)', + name: 'meta.stanza.dune', + patterns: [{include: '$self'}] + }, + { + begin: + '\\(\\s*(name|public_name|synopsis|install_c_headers|ppx_runtime_libraries|c_flags|cxx_flags|c_names|cxx_names|library_flags|c_library_flags|virtual_deps|modes|kind|wrapped|optional|self_build_stubs_archive|no_dynlink|ppx\\.driver)\\s', + beginCaptures: {1: {name: 'keyword.other.dune'}}, + end: '\\)', + name: 'meta.stanza.library.field.dune', + patterns: [{include: '$self'}] + }, + { + begin: '\\(\\s*(targets|deps|locks|loc|mode|action)\\s', + beginCaptures: {1: {name: 'keyword.other.dune'}}, + end: '\\)', + name: 'meta.stanza.rule.dune', + patterns: [{include: '$self'}] + }, + { + captures: {1: {name: 'keyword.other.dune'}}, + match: '\\(\\s*(fallback|optional)\\s*\\)', + name: 'meta.mono-sexp.dune' + }, + { + begin: + '\\(\\s*(run|chdir|setenv|with-stdout-to|with-stderr-to|with-outputs-to|ignore-stdout|ignore-stderr|ignore-outputs|progn|echo|cat|copy|copy#|system|bash|write-file|diff|diff\\?)\\s', + beginCaptures: {1: {name: 'entity.name.function.action.dune'}}, + end: '\\)', + name: 'meta.stanza.rule.action.dune', + patterns: [{include: '$self'}] + }, + { + begin: '\\(\\s*(section)\\s', + beginCaptures: {1: {name: 'keyword.other.dune'}}, + end: '\\)', + name: 'meta.stanza.install.dune', + patterns: [ + { + match: + '\\b(lib|libexec|bin|sbin|toplevel|share|share_root|etc|doc|stublibs|man|misc)\\b', + name: 'constant.language.rule.mode.dune' + } + ] + }, + { + begin: '\\(\\s*(files)\\s', + beginCaptures: {1: {name: 'keyword.other.dune'}}, + end: '\\)', + name: 'meta.stanza.install.dune', + patterns: [{include: '$self'}] + }, + { + begin: '\\(\\s*(normal|ppx_deriver|ppx_rewriter)\\s', + beginCaptures: {1: {name: 'constant.language.rule.mode.dune'}}, + end: '\\)', + name: 'meta.library.kind.dune' + }, + { + begin: '\\(\\s*(name|link_executables|link_flags|modes)\\s', + beginCaptures: {1: {name: 'keyword.other.dune'}}, + end: '\\)', + name: 'meta.stanza.executables.dune', + patterns: [{include: '$self'}] + }, + { + begin: + '\\(\\s*(preprocess|preprocessor_deps|lint|modules|modules_without_implementation|libraries|flags|ocamlc_flags|ocamlopt_flags|js_of_ocaml|allow_overlapping_dependencies|per_module)\\s', + beginCaptures: {1: {name: 'keyword.other.dune'}}, + end: '\\)', + name: 'meta.stanza.lib-or-exec.buildable.dune', + patterns: [{include: '$self'}] + }, + { + begin: '\\(\\s*(no_preprocessing|action|pps)\\s', + beginCaptures: {1: {name: 'keyword.other.dune'}}, + end: '\\)', + name: 'meta.stanza.lib-or-exec.buildable.preprocess.dune', + patterns: [{include: '$self'}] + }, + { + begin: '\\(\\s*(file|alias|alias_rec|glob_files|files_recursively_in)\\s', + beginCaptures: {1: {name: 'keyword.other.dune'}}, + end: '\\)', + name: 'meta.stanza.lib-or-exec.buildable.preprocess_deps.dune', + patterns: [{include: '$self'}] + }, + { + begin: '\\(\\s*(select)\\s', + beginCaptures: {1: {name: 'keyword.other.dune'}}, + end: '\\)', + name: 'meta.stanza.lib-or-exec.buildable.libraries.dune', + patterns: [{include: '$self'}] + }, + {match: '\\b\\d+\\b', name: 'constant.numeric.dune'}, + {match: '(true|false)', name: 'constant.language.dune'}, + {match: '\\s(as|from|->)\\s', name: 'keyword.other.dune'}, + {match: '(\\!)', name: 'keyword.other.dune'}, + {match: '(:\\w+)\\b', name: 'constant.language.flag.dune'}, + { + match: '\\b(standard|fallback|promote|promote-until-then)\\b', + name: 'constant.language.rule.mode.dune' + }, + {include: '#string'}, + {include: '#variable'}, + {include: '#list'}, + {include: '#atom'} + ], + repository: { + atom: {patterns: [{match: '\\b[^\\s]+\\b', name: 'meta.atom.dune'}]}, + 'comment-inner': { + patterns: [ + { + begin: '\\(', + end: '\\)', + name: 'comment.sexp.inner.dune', + patterns: [{include: '#comment-inner'}] + } + ] + }, + comments: { + patterns: [ + { + begin: '#\\|', + beginCaptures: { + 0: {name: 'punctuation.definition.comment.begin.dune'} + }, + end: '\\|#', + endCaptures: {0: {name: 'punctuation.definition.comment.end.dune'}}, + name: 'comment.block.dune', + patterns: [{include: '#comments'}] + }, + { + begin: '#;\\s*\\(', + end: '\\)', + name: 'comment.sexp.dune', + patterns: [{include: '#comment-inner'}] + }, + {match: ';.*$', name: 'comment.line.dune'} + ] + }, + list: { + patterns: [ + { + begin: '(\\()', + captures: {1: {name: 'entity.tag.list.parenthesis.dune'}}, + end: '(\\))', + name: 'meta.list.dune', + patterns: [{include: '$self'}] + } + ] + }, + string: { + patterns: [ + { + begin: '(?=[^\\\\])(")', + beginCaptures: { + 1: {name: 'punctuation.definition.string.begin.dune'} + }, + end: '(")', + endCaptures: {1: {name: 'punctuation.definition.string.end.dune'}}, + name: 'string.quoted.double.dune', + patterns: [ + {match: '\\\\"', name: 'constant.character.string.escape.dune'}, + {include: '#variable'} + ] + } + ] + }, + variable: {patterns: [{match: '\\${[^}]*}', name: 'variable.other.dune'}]} + }, + scopeName: 'source.dune' +} + +export default grammar diff --git a/lang/source.elvish.js b/lang/source.elvish.js index 7bd5716..4ac1609 100644 --- a/lang/source.elvish.js +++ b/lang/source.elvish.js @@ -20,14 +20,14 @@ const grammar = { }, {begin: "'", end: "'", name: 'string.quoted.single.elvish'}, {begin: '#', end: '$', name: 'comment.line.number-sign.elvish'}, - {match: '\\$[\\w\\d_:~-]+', name: 'variable.other.elvish'}, + {match: '\\$[\\w\\d_:~-]*', name: 'variable.other.elvish'}, { captures: { 1: {name: 'keyword.other.elvish'}, 2: {name: 'variable.other.elvish'} }, match: - '(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(var|set|tmp|del)((\\s+[\\w\\d_:~-]+)+)' + '(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(var|set|tmp|with|del)((\\s+[\\w\\d_:~-]+)+)' }, { captures: { @@ -41,7 +41,7 @@ const grammar = { 1: {name: 'keyword.control.elvish'}, 2: {name: 'variable.other.elvish'} }, - match: '(?<=})\\s+(catch|except)\\s+([\\w\\d_:~-]+)' + match: '(?<=})\\s+(catch)\\s+([\\w\\d_:~-]+)' }, { captures: {1: {name: 'support.function.elvish'}}, @@ -56,7 +56,7 @@ const grammar = { { captures: {1: {name: 'keyword.other.elvish'}}, match: - '(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(use|var|set|tmp|del|pragma|fn)(?=[\\s)}<>;|&])' + '(?<=\\G|^|\\{ |\\{\t|\\(|\\||\\;)\\s*(use|var|set|tmp|with|del|pragma|fn)(?=[\\s)}<>;|&])' }, { captures: {1: {name: 'keyword.control.elvish'}}, @@ -65,7 +65,7 @@ const grammar = { }, { captures: {1: {name: 'keyword.control.elvish'}}, - match: '(?<=})\\s+(elif|else|catch|except|finally)(?=[\\s)}<>;|&])' + match: '(?<=})\\s+(elif|else|catch|finally)(?=[\\s)}<>;|&])' }, {match: '[*?|&;<>()\\[\\]{}]', name: 'keyword.operator.elvish'} ], diff --git a/lang/source.fsharp.js b/lang/source.fsharp.js index 29c0ee3..ccb438a 100644 --- a/lang/source.fsharp.js +++ b/lang/source.fsharp.js @@ -258,7 +258,7 @@ const grammar = { 1: {name: 'keyword.symbol.fsharp'}, 2: {name: 'keyword.symbol.fsharp'} }, - end: "(\\)\\s*(([?[:alpha:]0-9'`^._ ]+))+)", + end: "(\\)\\s*(([?[:alpha:]0-9'`^._ ]+))*)", endCaptures: { 1: {name: 'keyword.symbol.fsharp'}, 2: {name: 'entity.name.type.fsharp'} @@ -373,7 +373,7 @@ const grammar = { patterns: [ { begin: - '\\b(let mutable|static let mutable|static let|let inline|let|and|member val|member inline|static member inline|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?', + '\\b(let mutable|static let mutable|static let|let inline|let|and|member val|member inline|static member inline|static member val|static member|default|member|override|let!)(\\s+rec|mutable)?(\\s+\\[\\<.*\\>\\])?\\s*(private|internal|public)?\\s+(\\[[^-=]*\\]|[_[:alpha:]]([_[:alpha:]0-9\\._]+)*|``[_[:alpha:]]([_[:alpha:]0-9\\._`\\s]+|(?<=,)\\s)*)?', beginCaptures: { 1: {name: 'keyword.fsharp'}, 2: {name: 'keyword.fsharp'}, @@ -565,7 +565,7 @@ const grammar = { {match: '(\\->|\\<\\-)', name: 'keyword.symbol.arrow.fsharp'}, { match: - '(&&&|\\|\\|\\||\\^\\^\\^|~~~|~\\+|~\\-|<<<|>>>|\\|>|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|&|%|{|}|\\||_|\\.\\.|\\,|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\(|\\)|\\<\\<)', + '[.?]*(&&&|\\|\\|\\||\\^\\^\\^|~~~|~\\+|~\\-|<<<|>>>|\\|>|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|&|%|{|}|\\||_|\\.\\.|\\,|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\(|\\)|\\<\\<)[.?]*', name: 'keyword.symbol.fsharp' } ] diff --git a/lang/source.gdscript.js b/lang/source.gdscript.js index d0a34a8..b9d7404 100644 --- a/lang/source.gdscript.js +++ b/lang/source.gdscript.js @@ -18,7 +18,7 @@ const grammar = { beginCaptures: { 1: {name: 'variable.parameter.function.language.gdscript'}, 2: {name: 'punctuation.separator.annotation.gdscript'}, - 3: {name: 'entity.name.type.class.builtin.gdscript'} + 3: {name: 'entity.name.type.class.gdscript'} }, end: '(,)|(?=\\))', endCaptures: {1: {name: 'punctuation.separator.parameters.gdscript'}}, @@ -37,7 +37,7 @@ const grammar = { }, any_method: { match: '\\b([A-Za-z_]\\w*)\\b(?=\\s*(?:[(]))', - name: 'support.function.any-method.gdscript' + name: 'entity.name.function.other.gdscript' }, any_property: { captures: { @@ -53,7 +53,7 @@ const grammar = { name: 'variable.other.gdscript' }, arithmetic_operator: { - match: '->|\\+=|-=|\\*=|/=|%=|&=|\\|=|\\*|/|%|\\+|-|<<|>>|&|\\||\\^|~|!', + match: '->|\\+=|-=|\\*=|\\^=|/=|%=|&=|~=|\\|=|\\*\\*|\\*|/|%|\\+|-', name: 'keyword.operator.arithmetic.gdscript' }, assignment_operator: { @@ -66,11 +66,10 @@ const grammar = { {include: '#nodepath_object'}, {include: '#nodepath_function'}, {include: '#strings'}, + {include: '#builtin_classes'}, {include: '#const_vars'}, {include: '#keywords'}, - {include: '#logic_operator'}, - {include: '#compare_operator'}, - {include: '#arithmetic_operator'}, + {include: '#operators'}, {include: '#lambda_declaration'}, {include: '#class_declaration'}, {include: '#variable_declaration'}, @@ -81,6 +80,9 @@ const grammar = { {include: '#assignment_operator'}, {include: '#in_keyword'}, {include: '#control_flow'}, + {include: '#match_keyword'}, + {include: '#curly_braces'}, + {include: '#square_braces'}, {include: '#round_braces'}, {include: '#function_call'}, {include: '#comment'}, @@ -88,11 +90,18 @@ const grammar = { {include: '#func'}, {include: '#letter'}, {include: '#numbers'}, - {include: '#builtin_classes'}, {include: '#pascal_case_class'}, {include: '#line_continuation'} ] }, + bitwise_operator: { + match: '&|\\||<<=|>>=|<<|>>|\\^|~', + name: 'keyword.operator.bitwise.gdscript' + }, + boolean_operator: { + match: '(&&|\\|\\|)', + name: 'keyword.operator.boolean.gdscript' + }, builtin_classes: { match: '(?=|==|<|>|!=', + match: '<=|>=|==|<|>|!=|!', name: 'keyword.operator.comparison.gdscript' }, const_vars: { @@ -195,9 +204,16 @@ const grammar = { }, control_flow: { match: - '\\b(?:if|elif|else|while|break|continue|pass|return|match|yield|await)\\b', + '\\b(?:if|elif|else|while|break|continue|pass|return|when|yield|await)\\b', name: 'keyword.control.gdscript' }, + curly_braces: { + begin: '\\{', + beginCaptures: {0: {name: 'punctuation.definition.dict.begin.gdscript'}}, + end: '\\}', + endCaptures: {0: {name: 'punctuation.definition.dict.end.gdscript'}}, + patterns: [{include: '#base_expression'}, {include: '#any_variable'}] + }, expression: { patterns: [ {include: '#base_expression'}, @@ -254,10 +270,7 @@ const grammar = { ] }, function_call: { - begin: '(?x)\n \\b(?=\n ([a-zA-Z_]\\w*) \\s* (\\()\n )\n', - beginCaptures: { - 2: {name: 'punctuation.definition.arguments.begin.gdscript'} - }, + begin: '(?=\\b[a-zA-Z_]\\w*\\b\\()', end: '(\\))', endCaptures: {1: {name: 'punctuation.definition.arguments.end.gdscript'}}, name: 'meta.function-call.gdscript', @@ -280,10 +293,8 @@ const grammar = { function_name: { patterns: [ {include: '#builtin_classes'}, - { - match: '(?x)\n \\b ([a-zA-Z_]\\w*) \\b\n', - name: 'support.function.any-method.gdscript' - } + {match: '\\b(preload)\\b', name: 'keyword.language.gdscript'}, + {match: '\\b([a-zA-Z_]\\w*)\\b', name: 'entity.name.function.gdscript'} ] }, getter_setter_godot4: { @@ -319,7 +330,7 @@ const grammar = { }, keywords: { match: - '\\b(?:class|class_name|is|onready|tool|static|export|as|void|enum|preload|assert|breakpoint|rpc|sync|remote|master|puppet|slave|remotesync|mastersync|puppetsync|trait|namespace)\\b', + '\\b(?:class|class_name|is|onready|tool|static|export|as|void|enum|assert|breakpoint|sync|remote|master|puppet|slave|remotesync|mastersync|puppetsync|trait|namespace)\\b', name: 'keyword.language.gdscript' }, lambda_declaration: { @@ -361,10 +372,6 @@ const grammar = { } ] }, - logic_operator: { - match: '\\b(and|or|not|!)\\b', - name: 'keyword.operator.wordlike.gdscript' - }, loose_default: { begin: '(=)', beginCaptures: {1: {name: 'keyword.operator.gdscript'}}, @@ -372,6 +379,10 @@ const grammar = { endCaptures: {1: {name: 'punctuation.separator.parameters.gdscript'}}, patterns: [{include: '#base_expression'}] }, + match_keyword: { + captures: {1: {name: 'keyword.control.gdscript'}}, + match: '^\n\\s*(match)' + }, nodepath_function: { begin: '(get_node_or_null|has_node|has_node_and_resource|find_node|get_node)\\s*(\\()', @@ -379,17 +390,20 @@ const grammar = { 1: {name: 'entity.name.function.gdscript'}, 2: {name: 'punctuation.definition.parameters.begin.gdscript'} }, + contentName: 'meta.function.parameters.gdscript', end: '(\\))', endCaptures: { 1: {name: 'punctuation.definition.parameters.end.gdscript'} }, + name: 'meta.function.gdscript', patterns: [ { begin: '("|\')', end: '\\1', name: 'string.quoted.gdscript meta.literal.nodepath.gdscript constant.character.escape', patterns: [{match: '%', name: 'keyword.control.flow'}] - } + }, + {include: '#base_expression'} ] }, nodepath_object: { @@ -428,6 +442,15 @@ const grammar = { {match: '[-]?[0-9][0-9_]*', name: 'constant.numeric.integer.gdscript'} ] }, + operators: { + patterns: [ + {include: '#wordlike_operator'}, + {include: '#boolean_operator'}, + {include: '#arithmetic_operator'}, + {include: '#bitwise_operator'}, + {include: '#compare_operator'} + ] + }, parameters: { begin: '(\\()', beginCaptures: { @@ -452,7 +475,7 @@ const grammar = { ] }, pascal_case_class: { - match: '\\b([A-Z][a-z_0-9]*([A-Z]?[a-z_0-9]+)*[A-Z]?)\\b', + match: '\\b([A-Z]+[a-z_0-9]*([A-Z]?[a-z_0-9]+)*[A-Z]?)\\b', name: 'entity.name.type.class.gdscript' }, round_braces: { @@ -481,6 +504,13 @@ const grammar = { match: '(?x) \\s*\n (signal) \\s+\n ([a-zA-Z_]\\w*)(?=[\\n\\s])', name: 'meta.signal.gdscript' }, + square_braces: { + begin: '\\[', + beginCaptures: {0: {name: 'punctuation.definition.list.begin.gdscript'}}, + end: '\\]', + endCaptures: {0: {name: 'punctuation.definition.list.end.gdscript'}}, + patterns: [{include: '#base_expression'}, {include: '#any_variable'}] + }, statement: {patterns: [{include: '#extends_statement'}]}, statement_keyword: { patterns: [ @@ -497,7 +527,31 @@ const grammar = { } ] }, - string_formatting: { + string_bracket_placeholders: { + patterns: [ + { + captures: { + 1: {name: 'constant.character.format.placeholder.other.gdscript'}, + 3: {name: 'storage.type.format.gdscript'}, + 4: {name: 'storage.type.format.gdscript'} + }, + match: + '(?x)\n (\n {{ | }}\n | (?:\n {\n \\w* (\\.[[:alpha:]_]\\w* | \\[[^\\]\'"]+\\])*\n (![rsa])?\n ( : \\w? [<>=^]? [-+ ]? \\#?\n \\d* ,? (\\.\\d+)? [bcdeEfFgGnosxX%]? )?\n })\n )\n', + name: 'meta.format.brace.gdscript' + }, + { + captures: { + 1: {name: 'constant.character.format.placeholder.other.gdscript'}, + 3: {name: 'storage.type.format.gdscript'}, + 4: {name: 'storage.type.format.gdscript'} + }, + match: + '(?x)\n (\n {\n \\w* (\\.[[:alpha:]_]\\w* | \\[[^\\]\'"]+\\])*\n (![rsa])?\n (:)\n [^\'"{}\\n]* (?:\n \\{ [^\'"}\\n]*? \\} [^\'"{}\\n]*\n )*\n }\n )\n', + name: 'meta.format.brace.gdscript' + } + ] + }, + string_percent_placeholders: { captures: { 1: {name: 'constant.character.format.placeholder.other.gdscript'} }, @@ -512,20 +566,18 @@ const grammar = { name: 'string.quoted.gdscript', patterns: [ {match: '\\\\.', name: 'constant.character.escape.gdscript'}, - {include: '#string_formatting'} + {include: '#string_percent_placeholders'}, + {include: '#string_bracket_placeholders'} ] }, variable_declaration: { - begin: - '\\b(?:(var)|(const))\\s+(?:(\\b[A-Z_][A-Z_0-9]*\\b)|([A-Za-z_]\\w*))\\s*', + begin: '\\b(?:(var)|(const))\\b', beginCaptures: { 1: {name: 'keyword.language.gdscript storage.type.var.gdscript'}, - 2: {name: 'keyword.language.gdscript storage.type.const.gdscript'}, - 3: {name: 'constant.language.gdscript'}, - 4: {name: 'variable.other.gdscript'} + 2: {name: 'keyword.language.gdscript storage.type.const.gdscript'} }, end: '$|;', - name: 'meta.variable.gdscript', + name: 'meta.variable.declaration.gdscript', patterns: [ { captures: { @@ -557,6 +609,10 @@ const grammar = { {include: '#any_property'}, {include: '#keywords'} ] + }, + wordlike_operator: { + match: '\\b(and|or|not)\\b', + name: 'keyword.operator.wordlike.gdscript' } }, scopeName: 'source.gdscript' diff --git a/lang/source.generic-db.js b/lang/source.generic-db.js index a0da206..5e3d172 100644 --- a/lang/source.generic-db.js +++ b/lang/source.generic-db.js @@ -10,8 +10,8 @@ /** @type {Grammar} */ const grammar = { dependencies: ['etc'], - extensions: ['.tsv'], - names: ['tsv'], + extensions: ['.tsv', '.vcf'], + names: ['tsv', 'tab-seperated-values'], patterns: [ { begin: diff --git a/lang/source.gitconfig.js b/lang/source.gitconfig.js index 4c66e08..2086bbc 100644 --- a/lang/source.gitconfig.js +++ b/lang/source.gitconfig.js @@ -11,6 +11,21 @@ const grammar = { dependencies: ['source.shell'], extensions: ['.gitconfig'], + injections: { + 'L:meta.alias.gitconfig source.embedded.shell, L:meta.command.gitconfig - string.quoted': + {patterns: [{include: '#escapedNewline'}]}, + 'L:string.quoted.double.gitconfig source.embedded.shell - string.quoted.*.shell': + { + patterns: [ + { + begin: '\\s*(?)', name: 'keyword.operator.arrow.gleam'}, {match: '\\|>', name: 'keyword.operator.pipe.gleam'}, {match: '\\.\\.', name: 'keyword.operator.splat.gleam'}, + {match: '(==|!=)', name: 'keyword.operator.comparison.gleam'}, { - match: '(<=\\.|>=\\.|==\\.|!=\\.|<\\.|>\\.)', + match: '(<=\\.|>=\\.|<\\.|>\\.)', name: 'keyword.operator.comparison.float.gleam' }, - { - match: '(<=|>=|==|!=|<|>)', - name: 'keyword.operator.comparison.int.gleam' - }, + {match: '(<=|>=|<|>)', name: 'keyword.operator.comparison.int.gleam'}, {match: '(&&|\\|\\|)', name: 'keyword.operator.logical.gleam'}, {match: '<>', name: 'keyword.operator.string.gleam'}, {match: '\\|', name: 'keyword.operator.other.gleam'}, { - match: '(\\+\\.|\\-\\.|/\\.|\\*\\.|%\\.)', + match: '(\\+\\.|\\-\\.|/\\.|\\*\\.)', name: 'keyword.operator.arithmetic.float.gleam' }, { @@ -100,7 +94,7 @@ const grammar = { ] }, octal_number: { - match: '\\b0[oO](_?[0-7])+\\b', + match: '\\b0[oO]0*[1-7][0-7]*\\b', name: 'constant.numeric.octal.gleam' }, strings: { diff --git a/lang/source.hosts.js b/lang/source.hosts.js index 3c85702..a7f483e 100644 --- a/lang/source.hosts.js +++ b/lang/source.hosts.js @@ -16,15 +16,195 @@ const grammar = { repository: { host: { captures: {0: {patterns: [{include: 'etc#dot'}]}}, - match: '(?<=\\s|^)[^:\\s#][^\\s#]*', + match: '(?<=\\s|^|,)[^:\\s#,][^\\s#,]*', name: 'entity.name.host.domain.hosts' }, + legacy: { + patterns: [ + {include: 'etc#commentSemi'}, + {include: '#legacy-dod'}, + {include: '#legacy-nic'} + ] + }, + 'legacy-dod': { + captures: { + 1: {name: 'storage.type.class.hosts'}, + 10: {patterns: [{include: 'etc#colon'}]}, + 11: { + name: 'meta.list.protocols.hosts', + patterns: [ + { + captures: {0: {patterns: [{include: '#legacy-sym'}]}}, + match: '[^\\s,:]+', + name: 'constant.other.protocol.hosts' + }, + {include: 'etc#comma'} + ] + }, + 12: {patterns: [{include: 'etc#colon'}]}, + 2: {patterns: [{include: 'etc#colon'}]}, + 3: { + name: 'meta.list.addresses.hosts', + patterns: [ + {include: 'etc#ipv4'}, + {include: 'etc#comma'}, + {include: '#legacy-host'} + ] + }, + 4: {patterns: [{include: 'etc#colon'}]}, + 5: {patterns: [{include: 'etc#comma'}, {include: '#host'}]}, + 6: {patterns: [{include: 'etc#colon'}]}, + 7: { + name: 'meta.list.cpus.hosts', + patterns: [ + {match: '[^\\s,:]+', name: 'constant.language.cpu-type.hosts'}, + {include: 'etc#comma'} + ] + }, + 8: {patterns: [{include: 'etc#colon'}]}, + 9: { + name: 'meta.list.systems.hosts', + patterns: [ + { + match: '[^\\s,:]+', + name: 'constant.language.operating-system.hosts' + }, + {include: 'etc#comma'} + ] + } + }, + match: + '(?x) ^ \\s*\n(NET|GATEWAY|HOST|DOMAIN) \\s* # Record type\n(:) \\s* ([^\\s:][^:\\r\\n]*) \\s* # IP address list\n(?:(:) \\s* ([^\\s:][^:\\r\\n]*) \\s*)? # Name\n(?:(:) \\s* ([^\\s:][^:\\r\\n]*|(?=:)) \\s*)? # CPU type\n(?:(:) \\s* ([^\\s:][^:\\r\\n]*|(?=:)) \\s*)? # Operating systems\n(?:(:) \\s* ([^\\s:][^:\\r\\n]*|(?=:)) \\s*)? # Protocols\n(:)(?=\\s*(?:$|;))', + name: 'meta.definition.${1:/downcase}.hosts.legacy' + }, + 'legacy-host': { + patterns: [ + { + begin: '\\s*(?=\\d)', + end: '(?!\\G)', + name: 'meta.host-number.unprefixed.arpa.hosts.legacy', + patterns: [{include: '#legacy-host-innards'}] + }, + { + begin: '\\b(ARPA|RCC|CHAOS|LCS|SU)(?=$|\\s|;)', + beginCaptures: {1: {name: 'entity.name.tag.network.hosts.legacy'}}, + end: '(?!\\G)', + name: 'meta.host-number.prefixed.${1:/downcase}.hosts.legacy', + patterns: [{include: '#legacy-host-innards'}] + }, + {include: '#legacy-host-innards'} + ] + }, + 'legacy-host-innards': { + patterns: [ + { + captures: { + 1: {name: 'constant.numeric.integer.int.octal.oct.hosts.legacy'} + }, + match: '(?<=CHAOS)\\G\\s+([0-7]+)\\b' + }, + { + applyEndPatternLast: true, + begin: + '(?x) \\G (?=\n\t(?: (?<=LCS) \\s+ [0-7]+ (?:/[0-7]+)? # LCS /\n\t| (?<=SU) \\s+ [0-7]+ (?:\\#[0-7]+)? # SU #\n\t) \\b(?!/|\\#)\n) \\s*', + end: '(?!\\G)', + patterns: [ + { + match: '\\G\\d+', + name: 'constant.numeric.integer.int.octal.oct.subnet-number.hosts.legacy' + }, + { + match: '(?!\\G)\\d+', + name: 'constant.numeric.integer.int.octal.oct.host-number.hosts.legacy' + }, + {include: '#legacy-sym'} + ] + }, + { + captures: { + 1: { + name: 'constant.numeric.integer.int.decimal.dec.host-number.hosts.legacy' + }, + 2: {patterns: [{include: '#legacy-sym'}]}, + 3: { + name: 'constant.numeric.integer.int.decimal.dec.imp-number.hosts.legacy' + } + }, + match: + '(?:^|\\G|(? +// and licensed `mit`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + extensions: ['.ics', '.ical'], + names: ['icalendar', 'ical'], + patterns: [ + {match: '^(BEGIN|END)', name: 'keyword.command.icalObject'}, + { + match: ':(VCALENDAR|VEVENT|VTODO|VJOURNAL|VFREEBUSY|VTIMEZONE|VALARM)$', + name: 'constant.language.icalObjectType' + }, + {match: ':(DAYLIGHT|STANDARD)$', name: 'constant.language.icalObjectType'}, + { + match: '^(DTSTART|PRODID|VERSION|CALSCALE|METHOD)', + name: 'keyword.other.icalProperty' + }, + { + match: '^(DTEND|DTSTAMP|ORGANIZER|UID|CLASS|CREATED)', + name: 'keyword.other.icalProperty' + }, + { + match: '^(LOCATION|SEQUENCE|STATUS|SUMMARY|COMMENT)', + name: 'keyword.other.icalProperty' + }, + { + match: '^(TRANSP|ATTENDEE|ATTACH|FREEBUSY|METHOD|CONTACT)', + name: 'keyword.other.icalProperty' + }, + { + match: '^(DURATION|RRULE|EXDATE|EXRULE|URL|DESCRIPTION|ACTION)', + name: 'keyword.other.icalProperty' + }, + { + match: '^(LAST-MODIFIED|RECURRENCE-ID|TRIGGER|RELATED-TO|RDATE)', + name: 'keyword.other.icalProperty' + }, + { + match: '^(TZID|TZOFFSETFROM|TZOFFSETTO|TZNAME|TZURL)', + name: 'keyword.other.icalProperty' + }, + { + match: '^(PRIORITY|DUE|COMPLETED|PERCENT-COMPLETE|CATEGORIES)', + name: 'keyword.other.icalProperty' + }, + { + match: '^(RESOURCES|REPEAT|REQUEST-STATUS)', + name: 'keyword.other.icalProperty' + }, + {match: '^X-[A-Z-]+', name: 'keyword.other.icalCustom'}, + {match: '[0-9]{8}T[0-9]{6}Z?', name: 'string.interpolated.icalDate'}, + {match: '[A-Z0-9-]+=[^;:]+', name: 'variable.parameter.icalParameter'}, + { + match: '(CONFIRMED|TENTATIVE|CANCELLED|DELEGATED|OPAQUE)', + name: 'constant.other.icalSetValue' + }, + { + match: '(NEEDS-ACTION|ACCEPTED|DECLINED|IN-PROGRESS)', + name: 'constant.other.icalSetValue' + }, + { + match: '(PRIVATE|PUBLIC|PUBLISH|GREGORIAN|DISPLAY)', + name: 'constant.other.icalSetValue' + }, + {match: ':COMPLETED$', name: 'constant.other.icalSetValue'} + ], + scopeName: 'source.iCalendar' +} + +export default grammar diff --git a/lang/source.ice.js b/lang/source.ice.js index 83d635c..d21990b 100644 --- a/lang/source.ice.js +++ b/lang/source.ice.js @@ -968,6 +968,14 @@ const grammar = { end: '(?=})', patterns: [ {include: '#standard'}, + { + begin: '(?=\\[)', + end: '(?<=])', + patterns: [ + {include: '#standard'}, + {include: '#metadata.local'} + ] + }, { begin: '\\\\?\\b\\w+\\b', beginCaptures: { @@ -1167,13 +1175,13 @@ const grammar = { }, 4: {name: 'punctuation.section.group.optional.end.ice'} }, - match: '((?:optional|tag))(\\()([-a-zA-Z0-9_:]*)(\\))' + match: '(optional)(\\()([-a-zA-Z0-9_:]*)(\\))' } ] } }, match: - '(?]))' + '((?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{So}←-⇿])(?:[[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{Mn}\u0001-¡]|[^\\P{Mc}\u0001-¡]|[^\\P{Nd}\u0001-¡]|[^\\P{Pc}\u0001-¡]|[^\\P{Sk}\u0001-¡]|[^\\P{Me}\u0001-¡]|[^\\P{No}\u0001-¡]|[′-‷⁗]|[^\\P{So}←-⇿])*)({(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*})?(?=\\([^#]*\\)(::[^\\s]+)?(\\s*\\bwhere\\b\\s+.+?)?\\s*?=(?![=>]))' }, { captures: { @@ -147,7 +148,7 @@ const grammar = { 4: {name: 'support.type.julia'} }, match: - '\\b(function|macro)(?:\\s+(?:{{id}}(\\.))?({{id}})({(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*})?|\\s*)(?=\\()' + '\\b(function|macro)(?:\\s+(?:(?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{So}←-⇿])(?:[[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{Mn}\u0001-¡]|[^\\P{Mc}\u0001-¡]|[^\\P{Nd}\u0001-¡]|[^\\P{Pc}\u0001-¡]|[^\\P{Sk}\u0001-¡]|[^\\P{Me}\u0001-¡]|[^\\P{No}\u0001-¡]|[′-‷⁗]|[^\\P{So}←-⇿])*(\\.))?((?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{So}←-⇿])(?:[[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{Mn}\u0001-¡]|[^\\P{Mc}\u0001-¡]|[^\\P{Nd}\u0001-¡]|[^\\P{Pc}\u0001-¡]|[^\\P{Sk}\u0001-¡]|[^\\P{Me}\u0001-¡]|[^\\P{No}\u0001-¡]|[′-‷⁗]|[^\\P{So}←-⇿])*)({(?:[^{}]|{(?:[^{}]|{[^{}]*})*})*})?|\\s*)(?=\\()' } ] }, @@ -181,11 +182,12 @@ const grammar = { match: '\\b(?!:_)(?:struct|mutable\\s+struct|abstract\\s+type|primitive\\s+type)\\s+({{id}})(\\s*(<:)\\s*{{id}}(?:{.*})?)?', + '(?>!:_)(?:struct|mutable\\s+struct|abstract\\s+type|primitive\\s+type)\\s+((?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{So}←-⇿])(?:[[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{Mn}\u0001-¡]|[^\\P{Mc}\u0001-¡]|[^\\P{Nd}\u0001-¡]|[^\\P{Pc}\u0001-¡]|[^\\P{Sk}\u0001-¡]|[^\\P{Me}\u0001-¡]|[^\\P{No}\u0001-¡]|[′-‷⁗]|[^\\P{So}←-⇿])*)(\\s*(<:)\\s*(?:[[:alpha:]_\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{So}←-⇿])(?:[[:word:]_!\\p{Lu}\\p{Ll}\\p{Lt}\\p{Lm}\\p{Lo}\\p{Nl}\\p{Sc}⅀-⅄∿⊾⊿⊤⊥∂∅-∇∎∏∐∑∞∟∫-∳⋀-⋃◸-◿♯⟘⟙⟀⟁⦰-⦴⨀-⨆⨉-⨖⨛⨜𝛁𝛛𝛻𝜕𝜵𝝏𝝯𝞉𝞩𝟃ⁱ-⁾₁-₎∠-∢⦛-⦯℘℮゛-゜𝟎-𝟡]|[^\\P{Mn}\u0001-¡]|[^\\P{Mc}\u0001-¡]|[^\\P{Nd}\u0001-¡]|[^\\P{Pc}\u0001-¡]|[^\\P{Sk}\u0001-¡]|[^\\P{Me}\u0001-¡]|[^\\P{No}\u0001-¡]|[′-‷⁗]|[^\\P{So}←-⇿])*(?:{.*})?)?', name: 'meta.type.julia' } ] diff --git a/lang/source.just.js b/lang/source.just.js index 4a80441..33c0c16 100644 --- a/lang/source.just.js +++ b/lang/source.just.js @@ -1,6 +1,6 @@ // This is a TextMate grammar distributed by `starry-night`. // This grammar is developed at -// +// // and licensed `mit`. // See for more info. /** @@ -12,76 +12,381 @@ const grammar = { extensions: ['.just'], names: ['just', 'justfile'], patterns: [ - {include: '#interpolate'}, {include: '#comments'}, - {include: '#scripts'}, + {include: '#import'}, + {include: '#module'}, + {include: '#alias'}, + {include: '#assignment'}, + {include: '#builtins'}, + {include: '#keywords'}, + {include: '#expression-operators'}, + {include: '#backtick'}, {include: '#strings'}, - {include: '#assignments'}, - {include: '#recipeDefinition'}, - {include: '#keywords'} + {include: '#parenthesis'}, + {include: '#recipes'}, + {include: '#recipe-operators'}, + {include: '#embedded-languages'}, + {include: '#escaping'} ], repository: { - assignments: { + alias: { + captures: { + 1: {name: 'keyword.other.reserved.just'}, + 2: {name: 'variable.name.alias.just'}, + 3: {name: 'keyword.operator.assignment.just'}, + 4: {name: 'variable.other.just'} + }, + match: + '(?x)\n ^\n (alias) \\s+ \n ([a-zA-Z_][a-zA-Z0-9_-]*) \\s* \n (:=) \\s* \n ([a-zA-Z_][a-zA-Z0-9_-]*)\n' + }, + assignment: { + patterns: [ + {include: '#variable-assignment'}, + {include: '#setting-assignment'} + ] + }, + backtick: { patterns: [ + { + begin: '(```)', + beginCaptures: {1: {name: 'string.interpolated.just'}}, + contentName: 'source.shell', + end: '(```)', + endCaptures: {1: {name: 'string.interpolated.just'}}, + patterns: [{include: 'source.shell'}] + }, { captures: { - 1: {name: 'storage.type.just'}, - 2: {name: 'variable.name.just'} + 1: {name: 'string.interpolated.just'}, + 2: {name: 'source.shell', patterns: [{include: 'source.shell'}]}, + 3: {name: 'string.interpolated.just'} }, - match: '^(export[\\s]?)?([a-zA-Z_][a-zA-Z0-9_-]*)=' + match: '(`)([^`]*)(`)' + } + ] + }, + boolean: { + patterns: [ + {match: '\\b(true|false)\\b', name: 'constant.language.boolean.just'} + ] + }, + 'builtin-functions': { + patterns: [ + { + match: + '(?x) \\b(\n arch|num_cpus|os|os_family|shell|env_var|env_var_or_default|env|\n is_dependency|invocation_directory|invocation_dir|invocation_directory_native|\n invocation_dir_native|justfile|justfile_directory|justfile_dir|just_executable|\n just_pid|source_file|source_directory|source_dir|module_file|module_directory|\n module_dir|append|prepend|encode_uri_component|quote|replace|replace_regex|\n trim|trim_end|trim_end_match|trim_end_matches|trim_start|trim_start_match|\n trim_start_matches|capitalize|kebabcase|lowercamelcase|lowercase|\n shoutykebabcase|shoutysnakecase|snakecase|titlecase|uppercamelcase|\n uppercase|absolute_path|blake3|blake3_file|canonicalize|extension|\n file_name|file_stem|parent_directory|parent_dir|without_extension|clean|join|\n path_exists|error|assert|sha256|sha256_file|uuid|choose|datetime|\n datetime_utc|semver_matches|cache_directory|cache_dir|config_directory|config_dir|\n config_local_directory|config_local_dir|data_directory|data_dir|data_local_directory|\n data_local_dir|executable_directory|executable_dir|home_directory|home_dir\n)\\b\n', + name: 'support.function.builtin.just' } ] }, - comments: {patterns: [{match: '^#[^!].*', name: 'comment.line.just'}]}, - interpolate: { + builtins: { + patterns: [ + { + match: '\\b(HEX|HEXLOWER|HEXUPPER)\\b', + name: 'constant.language.hex.just' + }, + {include: '#builtin-functions'}, + {include: '#literal'} + ] + }, + comments: { + patterns: [{match: '#([^!].*)$', name: 'comment.line.number-sign.just'}] + }, + 'control-keywords': { patterns: [ - {begin: '\\{\\{', end: '\\}\\}', name: 'string.interpolated.just'} + {match: '\\b(if|else)\\b', name: 'keyword.control.conditional.just'} ] }, + 'embedded-languages': { + patterns: [ + { + begin: '^\\s+(#!/usr/bin/env\\s+node.*)$', + beginCaptures: {1: {name: 'comment.line.number-sign.shebang.just'}}, + contentName: 'source.js', + end: '^$', + patterns: [{include: 'source.js'}] + }, + { + begin: '^\\s+(#!/usr/bin/env\\s+perl.*)$', + beginCaptures: {1: {name: 'comment.line.number-sign.shebang.just'}}, + contentName: 'source.perl', + end: '^$', + patterns: [{include: 'source.perl'}] + }, + { + begin: '^\\s+(#!/usr/bin/env\\s+python.*)$', + beginCaptures: {1: {name: 'comment.line.number-sign.shebang.just'}}, + contentName: 'source.python', + end: '^$', + patterns: [{include: 'source.python'}] + }, + { + begin: '^\\s+(#!/usr/bin/env\\s+ruby.*)$', + beginCaptures: {1: {name: 'comment.line.number-sign.shebang.just'}}, + contentName: 'source.ruby', + end: '^$', + patterns: [{include: 'source.ruby'}] + }, + { + begin: '^\\s+(#!/usr/bin/env\\s+(?:sh|bash|zsh|fish).*)$', + beginCaptures: {1: {name: 'comment.line.number-sign.shebang.just'}}, + contentName: 'source.shell', + end: '^$', + patterns: [{include: 'source.shell'}] + } + ] + }, + escaping: { + patterns: [ + { + captures: { + 1: {name: 'string.interpolated.escape.just'}, + 2: {patterns: [{include: '#expression'}]}, + 3: {name: 'string.interpolated.escape.just'} + }, + match: + '(?x)\n (?', - name: 'keyword.operator.dynamic-mark.begin.decrescendo.lilypond' - }, - {match: '\\\\!', name: 'keyword.operator.dynamic-mark.end.lilypond'}, - {match: '\\(', name: 'keyword.operator.slur.begin.lilypond'}, - {match: '\\)', name: 'keyword.operator.slur.end.lilypond'}, - { - match: '\\\\\\(', - name: 'keyword.operator.phrasing-slur.begin.lilypond' - }, - {match: '\\\\\\)', name: 'keyword.operator.phrasing-slur.end.lilypond'}, - { - begin: '\\\\=', - beginCaptures: {0: {name: 'entity.punctuation.slur-label.lilypond'}}, - end: '(?=\\\\?[()])', - name: 'meta.slur-label.lilypond', - patterns: [ - {include: '#comments'}, - {match: '[-\\w]+', name: 'entity.name.slur-label.lilypond'}, - { - begin: '"', - beginCaptures: { - 0: {name: 'punctuation.definition.string.begin.lilypond'} - }, - contentName: 'entity.name.slur-label.lilypond', - end: '"', - endCaptures: { - 0: {name: 'punctuation.definition.string.end.lilypond'} - }, - name: 'string.lilypond', - patterns: [ - { - match: '\\\\[nt"\'\\\\]', - name: 'constant.character.escape.lilypond' - } - ] - } - ] - }, - { - begin: '<(?!<)', - beginCaptures: { - 0: {name: 'punctuation.definition.chord.begin.lilypond'} - }, - end: '(?])>', - endCaptures: {0: {name: 'punctuation.definition.chord.end.lilypond'}}, - name: 'meta.chord.lilypond', - patterns: [ - {match: '<', name: 'invalid.illegal.lilypond'}, - {include: '#music_expression_contents'} - ] - }, - { - match: '(?])>', + endCaptures: {0: {name: 'punctuation.definition.chord.end.lilypond'}}, + name: 'meta.chord.lilypond', patterns: [ - {include: '#octave_transpose_operators'}, - {include: '$self'} + {match: '<', name: 'invalid.illegal.lilypond'}, + {include: '#comments'}, + {include: '#expression_component'} ] }, { - begin: '\\\\notemode(?!-?[[:alpha:]])', - beginCaptures: {0: {name: 'keyword.other.lilypond'}}, - end: '(?<=[^%]})|(?<=^})', - name: 'meta.note-mode.lilypond', - patterns: [{include: '#music_expression'}, {include: '$self'}] - }, - { - begin: '\\\\markup(?:list)?(?!-?[[:alpha:]])', - beginCaptures: {0: {name: 'keyword.other.lilypond'}}, - end: '(?', name: 'punctuation.greater-than-sign.lilypond'}, + {match: '\\+', name: 'punctuation.plus-sign.lilypond'}, + {match: '/(?!\\+)', name: 'keyword.operator.forward-slash.lilypond'}, + {match: '~', name: 'punctuation.tilde.lilypond'}, + {match: '\\[', name: 'keyword.operator.beam.begin.lilypond'}, + {match: '\\]', name: 'keyword.operator.beam.end.lilypond'}, + {match: '\\|', name: 'keyword.operator.bar-check.lilypond'}, + { + match: '\\\\<', + name: 'keyword.operator.dynamic-mark.begin.crescendo.lilypond' + }, + { + match: '\\\\>', + name: 'keyword.operator.dynamic-mark.begin.decrescendo.lilypond' + }, + {match: '\\\\!', name: 'keyword.operator.dynamic-mark.end.lilypond'}, + {match: '\\(', name: 'keyword.operator.slur.begin.lilypond'}, + {match: '\\)', name: 'keyword.operator.slur.end.lilypond'}, + { + match: '\\\\\\(', + name: 'keyword.operator.phrasing-slur.begin.lilypond' + }, + {match: '\\\\\\)', name: 'keyword.operator.phrasing-slur.end.lilypond'}, + { + begin: '\\\\=', + beginCaptures: {0: {name: 'entity.punctuation.slur-label.lilypond'}}, + end: '(?=\\\\?[()])', + name: 'meta.slur-label.lilypond', + patterns: [ + {include: '#comments'}, + {match: '[-\\w]+', name: 'entity.name.slur-label.lilypond'}, + { + begin: '"', + beginCaptures: { + 0: {name: 'punctuation.definition.string.begin.lilypond'} + }, + contentName: 'entity.name.slur-label.lilypond', + end: '"', + endCaptures: { + 0: {name: 'punctuation.definition.string.end.lilypond'} + }, + name: 'string.lilypond', + patterns: [ + { + match: '\\\\[nt"\'\\\\]', + name: 'constant.character.escape.lilypond' + } + ] + } + ] + }, + { + match: '\\\\(?=\\d)', + name: 'keyword.operator.string-number-indicator.lilypond' + }, + {match: '\\\\\\[', name: 'invalid.deprecated.ligature.begin.lilypond'}, + {match: '\\\\\\]', name: 'invalid.deprecated.ligature.end.lilypond'}, + { + begin: '(?:(#)|(\\$)|([#$]@))', beginCaptures: { 1: {name: 'keyword.operator.scheme.embed.lilypond'}, 2: {name: 'keyword.operator.scheme.evaluate.lilypond'}, 3: {name: 'keyword.operator.scheme.list-splice.lilypond'} }, - end: '(?=\\s)|$', + end: '(?<=[\\w)}])|$', name: 'meta.scheme.lilypond', - patterns: [{include: '#scheme_expression'}, {include: 'source.lisp'}] - }, - { - match: '\\\\[[:alpha:]]+(?:-[[:alpha:]]+)*', - name: 'variable.other.lilypond' + patterns: [ + { + begin: '\\G(?: +|$)', + end: '(?! |$|#?;)', + name: 'meta.scheme-comments.lilypond', + patterns: [ + { + begin: '#?;', + beginCaptures: { + 0: {name: 'punctuation.definition.comment.lilypond'} + }, + end: '$', + name: 'comment.line.lilypond-scheme' + } + ] + }, + {include: '#scheme_embedded_lilypond'}, + { + begin: '(?! |$|#?;)', + end: '(?=\\s)|$', + name: 'meta.scheme-datum.lilypond', + patterns: [ + {include: '#scheme_expression'}, + {include: 'source.lisp'} + ] + } + ] } ] }, @@ -398,157 +366,39 @@ const grammar = { } ] }, - general_operators: { - patterns: [ - {match: '\\.', name: 'keyword.operator.dot.lilypond'}, - {match: '=', name: 'keyword.operator.equals-sign.lilypond'} - ] - }, integer: { patterns: [{match: '\\d+', name: 'constant.numeric.integer.lilypond'}] }, - lyric_expression: { + paper_expression: { patterns: [ { begin: '{', end: '}', - name: 'meta.lyric-expression.lilypond', + name: 'meta.paper-expression.lilypond', patterns: [ { - match: '(?<=[\\d\\s])--(?=\\s)', - name: 'keyword.operator.lyric.syllable-hyphen.lilypond' - }, - { - match: '(?<=\\S)_(?=\\S)', - name: 'keyword.operator.lyric.syllable-space.lilypond' - }, - { - match: '(?<=\\S)~(?=\\S)', - name: 'keyword.operator.lyric.tie.lilypond' - }, - { - match: '(?<=[\\d\\s])__(?=\\s)', - name: 'keyword.operator.lyric.extender-line.lilypond' - }, - { - match: '(?<=[\\d\\s])_(?=\\s)', - name: 'keyword.operator.lyric.melisma.lilypond' + match: '\\\\(?:[cm]m|in|pt)(?!-?[[:alpha:]])', + name: 'support.constant.lilypond' }, - {include: '#lyric_expression'}, - {include: '#expression'} - ] - } - ] - }, - markup_command: { - patterns: [ - { - match: - '\\\\(a(?:bs-fontsize|rrow-head|uto-footnote)|b(?:ackslashed-digit|eam|o(?:ld|x)|racket)|c(?:aps|enter-(?:(?:alig|colum)n)|har|ircle|o(?:lumn(?:(?:-lines)?)|m(?:(?:bin|mand-nam)e)|ncat))|d(?:ir-column|ouble(?:flat|sharp)|raw-(?:(?:circl|(?:(?:d(?:(?:ash|ott)ed-)|h|squiggle-)?)lin)e)|ynamic)|e(?:llipse|psfile|yeglasses)|f(?:ermata|i(?:ll(?:-(?:line|with-pattern)|ed-box)|nger|rst-visible)|lat|o(?:nt(?:Caps|size)|otnote)|r(?:action|et-diagram(?:(?:-(?:(?:ter|verbo)se))?)|omproperty))|general-align|h(?:a(?:lign|rp-pedal)|bracket|center-in|(?:spac|ug)e)|italic|justif(?:ied-lines|y(?:(?:-(?:field|line|string))?))|l(?:arge(?:(?:r)?)|eft-(?:align|brace|column)|ine|o(?:okup|wer))|m(?:a(?:gnify|p-markup-commands|rk(?:alphabet|letter))|edium|usicglyph)|n(?:atural|o(?:rmal(?:-(?:size-su(?:b|per)|text)|size)|te(?:(?:-by-number)?))|u(?:ll|mber))|o(?:n-the-fly|v(?:al|er(?:lay|ride(?:(?:-lines)?)|tie)))|p(?:a(?:d-(?:around|markup|(?:(?:to-bo)?)x)|ge-(?:link|ref)|renthesize|t(?:h|tern))|ostscript|roperty-recursive|ut-adjacent)|r(?:aise|e(?:place|st(?:(?:-by-number)?))|ight-(?:align|brace|column)|o(?:man|tate|unded-box))|s(?:ans|c(?:ale|ore(?:(?:-lines)?))|e(?:mi(?:flat|sharp)|squi(?:flat|sharp))|harp|imple|lashed-digit|mall(?:(?:Caps|er)?)|t(?:encil|rut)|u(?:b|per))|t(?:able(?:(?:-of-contents)?)|e(?:eny|xt)|i(?:e(?:(?:d-lyric)?)|ny)|r(?:ans(?:late(?:(?:-scaled)?)|parent)|iangle)|ypewriter)|u(?:nder(?:(?:lin|ti)e)|pright)|v(?:center|(?:erbatim-fil|spac)e)|w(?:hiteout|ith-(?:color|dimensions(?:(?:-from)?)|link|outline|url)|ordwrap(?:(?:-(?:field|internal|lines|string(?:(?:-internal)?)))?)))(?!-?[[:alpha:]])', - name: 'support.function.lilypond' - } - ] - }, - markup_expression: { - patterns: [ - { - begin: '{', - end: '}', - name: 'meta.markup-expression.lilypond', - patterns: [ - {include: '#markup_command'}, - {include: '#markup_expression'}, - {include: '#expression'} + {include: '#paper_expression'}, + {include: '$self'} ] } ] }, - music_expression: { - patterns: [ - { - begin: '{', - end: '}', - name: 'meta.music-expression.lilypond', - patterns: [{include: '#music_expression_contents'}] - } - ] - }, - music_expression_contents: { - patterns: [ - {include: '#music_notation'}, - {include: '#octave_transpose_operators'}, - {match: '!', name: 'keyword.operator.accidental.reminder.lilypond'}, - {match: '\\?', name: 'keyword.operator.accidental.cautionary.lilypond'}, - {include: '$self'} - ] - }, - music_notation: { + scheme_embedded_lilypond: { patterns: [ { - begin: '(\\^)|(_)|(-)', + begin: '#\\{', beginCaptures: { - 1: { - name: 'keyword.operator.articulation-direction-indicator.up.lilypond' - }, - 2: { - name: 'keyword.operator.articulation-direction-indicator.down.lilypond' - }, - 3: { - name: 'keyword.operator.articulation-direction-indicator.default.lilypond' - } + 0: {name: 'punctuation.definition.embedded-lilypond.begin.lilypond'} }, - end: '(\\^)|(\\+)|(-)|(!)|(>)|(\\.)|(_)|(?=[^\\s%])', + end: '#}', endCaptures: { - 1: {name: 'keyword.operator.articulation.marcato.lilypond'}, - 2: {name: 'keyword.operator.articulation.stopped.lilypond'}, - 3: {name: 'keyword.operator.articulation.tenuto.lilypond'}, - 4: {name: 'keyword.operator.articulation.staccatissimo.lilypond'}, - 5: {name: 'keyword.operator.articulation.accent.lilypond'}, - 6: {name: 'keyword.operator.articulation.staccato.lilypond'}, - 7: {name: 'keyword.operator.articulation.portato.lilypond'} + 0: {name: 'punctuation.definition.embedded-lilypond.end.lilypond'} }, - patterns: [{include: '#comments'}] - }, - {include: '#chord_mode_notation'}, - { - match: '\\^', - name: 'keyword.operator.articulation-direction-indicator.up.lilypond' - }, - { - match: '(? +// and licensed `bsd-3-clause`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + extensions: ['.livecodescript'], + names: ['livecode-script'], + patterns: [{include: '#language'}, {include: '#line-continuation'}], + repository: { + constants: { + patterns: [ + { + match: + '(?i)\\b(SIX|TEN|FORMFEED|NINE|ZERO|NONE|SPACE|FOUR|FALSE|COLON|CRLF|PI|COMMA|ENDOFFILE|EOF|EIGHT|FIVE|QUOTE|EMPTY|ONE|TRUE|((?<=\\w\\s)RETURN)|CR|LINEFEED|RIGHT|BACKSLASH|NULL|SEVEN|TAB|THREE|TWO)\\b', + name: 'constant.language.livecodescript' + }, + {match: '\\bk[A-Z]{1}.*?\\b', name: 'constant.language.livecodescript'}, + {begin: '"', end: '"', name: 'string.quoted.double.livecodescript'} + ] + }, + language: { + patterns: [ + { + begin: '/\\*', + captures: { + 0: {name: 'punctuation.definition.comment.livecodescript'} + }, + end: '\\*/', + name: 'comment.block.livecodescript' + }, + { + begin: '--', + beginCaptures: { + 0: { + name: 'punctuation.definition.comment.double-dash.livecodescript' + } + }, + end: '\\n', + name: 'comment.line.livecodescript' + }, + { + begin: '#', + beginCaptures: { + 0: { + name: 'punctuation.definition.comment.number-sign.livecodescript' + } + }, + end: '\\n', + name: 'comment.line.livecodescript' + }, + { + begin: '//', + beginCaptures: { + 0: { + name: 'punctuation.definition.comment.double-slash.livecodescript' + } + }, + end: '\\n', + name: 'comment.line.livecodescript' + }, + { + match: + '\\b(after|byte(s)*|codepoint(s)*|codeunit(s)*|english|segment(s)*|sentence(s)*|paragraph|the|trueWord(s)*|until|word(s)*|http|forever|descending|using|line|real8|with|seventh|for|stdout|finally|element|word|fourth|before|black|ninth|sixth|characters|chars|stderr|uInt(1|1s|2|2s)|stdin|string|lines|relative|rel|any|fifth|items|from|middle|mid|at|else|of|catch|then|third|it|file|milli(seconds|second|secs|sec)|int(1|1s|4|4s|ernet|2|2s)|normal|text|item|last|long|detailed|effective|uInt4|uInt4s|se(conds|cond|cs|c)|repeat|end\\s+repeat|URL|in|end\\s+try|into|switch|end\\s+switch|to|words|https|token|binfile|each|tenth|as|ticks|tick|system|real4|by|dateItems|without|cha(r|racter)|ascending|eighth|whole|dateTime|numeric|short|first|ftp|integer|abbreviated|abb(r|rev)|private|case|default|while|if|end\\s+if)\\b', + name: 'keyword.control.livecodescript' + }, + { + captures: {1: {name: 'keyword.control.exception.livecodescript'}}, + match: '\\b(catch)\\b\\s*([A-Za-z_][A-Za-z_0-9]*)', + name: 'meta.catch.livecodescript' + }, + { + match: '\\b(catch|try|throw)\\b', + name: 'keyword.control.exception.livecodescript' + }, + { + begin: '/\\*', + captures: { + 0: {name: 'punctuation.definition.comment.livecodescript'} + }, + end: '\\*/', + name: 'comment.block.livecodescript' + }, + { + captures: { + 1: {name: 'storage.type.function.livecodescript'}, + 2: {name: 'storage.type.function.livecodescript'}, + 3: {name: 'entity.name.function.livecodescript'}, + 4: {name: 'punctuation.definition.variable.livecodescript'} + }, + match: + '(private\\s+)*(\\b(?i)function|getprop|setprop|after|before|on|command|before|after)\\s+([A-Za-z_0-9-.]+)(\\s+@*[A-Za-z_0-9-]+,*?\\s+.*)*', + name: 'meta.function.livecodescript' + }, + { + captures: { + 1: {name: 'storage.type.function.end.livecodescript'}, + 2: {name: 'entity.name.function.livecodescript'} + }, + match: '((?i)end){1}\\s+?([A-Za-z_0-9-.]+)?', + name: 'meta.function.end.livecodescript' + }, + { + match: '(\\-|\\+|\\*|/|%)', + name: 'keyword.operator.arithmetic.livecodescript' + }, + { + match: '(?i)\\b(and|or)\\b', + name: 'keyword.operator.logical.livecodescript' + }, + { + match: '(?i)\\b(bitAnd|bitNot|bitOr|bitXor)\\b', + name: 'keyword.operator.bitwise.livecodescript' + }, + { + match: + '(?i)(=|<>|>=|<=|<|>)|\\b(is( among| not among| not in| a| an| not| in| not within| within| not a| not an)*|there is( no| not a| not an| a| an)|contains|ends with|begins with|is among the keys of|is not among the keys of)\\b', + name: 'keyword.operator.comparison.livecodescript' + }, + {match: '(&|&&)', name: 'keyword.operator.string.livecodescript'}, + { + match: '(\\^)|\\b(div|mod|wrap)\\b', + name: 'keyword.operator.other.livecodescript' + }, + { + match: + '(?i)(\\^)|\\b(abs|acos|aliasReference|annuity|arrayDecode|arrayEncode|asin|atan(2)*|average(Deviation)*|avg(Dev)*|base64Decode|base64Encode|baseConvert|binaryDecode|binaryEncode|byte(Offset|ToNum)+|cachedURL(s)*|charToNum|cipherNames|codepoint(Offset|Property|ToNum)+|codeunitOffset|commandNames|compound|compress|constantNames|cos|date(Format)*|decompress|directories|diskSpace|DNSServers|exp(1|2|10)*|extents|files|flushEvents|folders|format|functionNames|geometricMean|global(s|Names)+|harmonicMean|hasMemory|hostAddress|hostAddressToName|hostName(ToAddress)*|isNumber|ISOToMac|itemOffset|keys|len(gth)*|libURLErrorData|libUrlFormData|libURLftpCommand|libURLLastHTTPHeaders|libURLLastRHHeaders|libUrlMultipartFormAddPart|libUrlMultipartFormData|libURLVersion|lineOffset|ln(1)*|localNames|log(2|10)*|longFilePath|lower|macToISO|matchChunk|matchText|matrixMultiply|max|md5Digest|median|merge|milli(sec|secs|second|seconds)+|min|monthNames|nativeCharToNum|normalizeText|num(ber|ToByte|ToChar|ToCodepoint|ToNativeChar)*|offset|open(files|Processes)*|openProcessIDs|openSockets|paragraphOffset|paramCount|param(s)*|peerAddress|pendingMessages|platform|popStdDev|populationStandardDeviation|popVariance|populationVariance|processID|random(Bytes)*|replaceText|result|revCreateXMLTree|revCreateXMLTreeFromFile|revCurrentRecord|revCurrentRecordIsFirst|revCurrentRecordIsLast|revDatabaseColumnCount|revDatabaseColumnIsNull|revDatabaseColumnLengths|revDatabaseColumnName(s|d)+|revDatabaseColumnNumbered|revDatabaseColumnTypes|revDatabaseConnectResult|revDatabaseCursors|revDatabaseID|revDatabaseTableNames|revDatabaseType|revDataFromQuery|revdb_closeCursor|revdb_columnbynumber|revdb_columncount|revdb_columnisnull|revdb_columnlengths|revdb_columnnames|revdb_columntypes|revdb_commit|revdb_connect(ions)*|revdb_connectionerr|revdb_currentrecord|revdb_cursorconnection|revdb_cursorerr|revdb_cursors|revdb_dbtype|revdb_disconnect|revdb_execute|revdb_is(eof|bof)+|revdb_movefirst|revdb_movelast|revdb_movenext|revdb_moveprev|revdb_query|revdb_querylist|revdb_recordcount|revdb_rollback|revdb_tablenames|revGetDatabaseDriverPath|revNumberOfRecords|revOpenDatabase(s)*|revQueryDatabase(Blob)*|revQuery(Result|IsAtStart|IsAtEnd)+|revUnixFromMacPath|revXMLAttribute(s)*|revXMLAttributeValues|revXMLChildContents|revXMLChildNames|revXMLCreateTreeFromFileWithNamespaces|revXMLCreateTreeWithNamespaces|revXMLDataFromXPathQuery|revXMLEvaluateXPath|revXMLFirstChild|revXMLMatchingNode|revXMLNextSibling|revXMLNodeContents|revXMLNumberOfChildren|revXMLParent|revXMLPreviousSibling|revXMLRootNode|revXMLRPC_CreateRequest|revXMLRPC_Documents|revXMLRPC_Error|revXMLRPC_Execute|revXMLRPC_GetHost|revXMLRPC_GetMethod|revXMLRPC_GetParam|revXMLText|revXMLRPC_GetParamCount|revXMLRPC_GetParamNode|revXMLRPC_GetParamType|revXMLRPC_GetPath|revXMLRPC_GetPort|revXMLRPC_GetProtocol|revXMLRPC_GetRequest|revXMLRPC_GetResponse|revXMLRPC_GetSocket|revXMLTree(s)*|revXMLValidateDTD|revZipDescribeItem|revZipEnumerateItems|revZipOpenArchives|round|sampVariance|sec(s|onds)*|sentenceOffset|sha1Digest|shell|shortFilePath|sin|specialFolderPath|sqrt|standardDeviation|statRound|stdDev|sum|sysError|systemVersion|tan|tempName|textDecode|textEncode|tick(s)*|time|to(Lower|Upper)*|tokenOffset|transpose|truewordOffset|trunc|uniDecode|uniEncode|upper|urlDecode|urlEncode|urlStatus|uuid|value|variableNames|variance|version|waitDepth|weekdayNames|wordOffset|xsltApplyStylesheet|xsltApplyStylesheetFromFile|xsltLoadStylesheet|xsltLoadStylesheetFromFile)\\b', + name: 'storage.type.function.livecodescript' + }, + { + match: + '(?i)(\\^)|\\b(add|breakpoint|cancel|clear( local| global| variable| file| word| line| folder| directory| URL)*|close( file| socket| process)*|combine|constant|convert|(create|new)( alias| folder| directory)*|decrypt( using rsa)*|delete( directory| file| folder| global| line| local| session| URL| variable| word)*|dispatch|divide|do|encrypt( using rsa)*|filter|get|global|include|intersect|kill|libURLDownloadToFile|libURLFollowHttpRedirects|libURLftpUpload(File)*|libURLresetAll|libUrlSetAuthCallback|libURLSetCustomHTTPHeaders|libUrlSetExpect100|libURLSetFTPListCommand|libURLSetFTPMode|libURLSetFTPStopTime|libURLSetStatusCallback|load URL|local|multiply|open( socket| file| process)*|post|prepare|put( binary| content| cookie| header| markup| unicode)*|read( from process| from socket| from file)*|rename|replace|require|resetAll|resolve|revAddXMLNode|revAppendXML|revCloseCursor|revCloseDatabase|revCommitDatabase|revCopyFile|revCopyFolder|revCopyXMLNode|revDeleteFolder|revDeleteXMLNode|revDeleteAllXMLTrees|revDeleteXMLTree|revExecuteSQL|revGoURL|revInsertXMLNode|revMoveFolder|revMoveToFirstRecord|revMoveToLastRecord|revMoveToNextRecord|revMoveToPreviousRecord|revMoveToRecord|revMoveXMLNode|revPutIntoXMLNode|revRollBackDatabase|revSetDatabaseDriverPath|revSetXMLAttribute|revXMLRPC_AddParam|revXMLRPC_DeleteAllDocuments|revXMLAddDTD|revXMLRPC_Free|revXMLRPC_FreeAll|revXMLRPC_DeleteDocument|revXMLRPC_DeleteParam|revXMLRPC_SetHost|revXMLRPC_SetMethod|revXMLRPC_SetPort|revXMLRPC_SetProtocol|revXMLRPC_SetSocket|revZipAddItemWithData|revZipAddItemWithFile|revZipAddUncompressedItemWithData|revZipAddUncompressedItemWithFile|revZipCancel|revZipCloseArchive|revZipDeleteItem|revZipExtractItemToFile|revZipExtractItemToVariable|revZipSetProgressCallback|revZipRenameItem|revZipReplaceItemWithData|revZipReplaceItemWithFile|revZipOpenArchive|seek( to| rel| relative)*|send|set|sort|split|start( session)*|stop( session)*|subtract|union|unload( URL)*|wait|write)\\b', + name: 'storage.type.comnd.livecodescript' + }, + {include: '#constants'}, + {include: '#support'}, + {include: '#numbers'}, + {include: '#variables'} + ] + }, + 'line-continuation': { + patterns: [ + { + captures: { + 1: {name: 'punctuation.separator.continuation.line.livecodescript'}, + 2: {name: 'invalid.illegal.line.continuation.livecodescript'} + }, + match: '(\\\\)\\s*(\\S.*$\\n?)' + } + ] + }, + numbers: { + match: + '\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b', + name: 'constant.numeric.livecodescript' + }, + var_global: { + match: '\\bg[A-Z]{1}.*?\\b', + name: 'variable.other.global.livecodescript' + }, + var_local: { + match: '\\bt[he]*[A-Z]{1}.*?\\b', + name: 'variable.other.local.livecodescript' + }, + var_parameter: { + match: '\\bp[A-Z]{1}.*?\\b', + name: 'variable.other.param.livecodescript' + }, + var_scriptLocal: { + match: '\\bs[A-Z]{1}.*?\\b', + name: 'variable.other.scriptlocal.livecodescript' + }, + var_server: { + match: '\\$_[A-Z]+', + name: 'variable.other.server.livecodescript' + }, + variables: { + patterns: [ + {include: '#var_global'}, + {include: '#var_scriptLocal'}, + {include: '#var_local'}, + {include: '#var_parameter'}, + {include: '#var_server'} + ] + } + }, + scopeName: 'source.livecodescript' +} + +export default grammar diff --git a/lang/source.luau.js b/lang/source.luau.js index a81e7fb..df4c3f3 100644 --- a/lang/source.luau.js +++ b/lang/source.luau.js @@ -28,9 +28,22 @@ const grammar = { {include: '#parentheses'}, {include: '#table'}, {include: '#type_cast'}, - {include: '#type_annotation'} + {include: '#type_annotation'}, + {include: '#attribute'} ], repository: { + attribute: { + patterns: [ + { + captures: { + 1: {name: 'keyword.operator.attribute.luau'}, + 2: {name: 'storage.type.attribute.luau'} + }, + match: '(@)([a-zA-Z_][a-zA-Z0-9_]*)', + name: 'meta.attribute.luau' + } + ] + }, comment: { patterns: [ { @@ -235,6 +248,7 @@ const grammar = { end: '(?=\\s*do\\b|\\s*[=;]|\\s*$)', patterns: [ {include: '#comment'}, + {include: '#attribute'}, { begin: '(:)', beginCaptures: {1: {name: 'keyword.operator.type.luau'}}, diff --git a/lang/source.matlab.js b/lang/source.matlab.js index 85b8955..ddce1bc 100644 --- a/lang/source.matlab.js +++ b/lang/source.matlab.js @@ -68,7 +68,6 @@ const grammar = { patterns: [ { begin: '\\G(?!$)', - end: '(? +// // and licensed `mit`. // See for more info. /** @@ -11,719 +11,431 @@ const grammar = { extensions: ['.mcfunction'], names: ['mcfunction'], - patterns: [ - {include: '#comment'}, - {include: '#command'}, - {include: '#unknown'} - ], + patterns: [{include: '#root'}], repository: { - block_predicate: { + comments: { patterns: [ { - captures: { - 1: {name: 'entity.name.function.mcfunction'}, - 2: {name: 'entity.name.function.mcfunction'}, - 3: {name: 'entity.name.function.mcfunction'}, - 4: {name: 'entity.name.function.mcfunction'} - }, - match: '(\\#)([a-z0-9_\\.\\-]+)(\\:)([a-z0-9_\\.\\-\\/]+)' - }, - { - captures: { - 1: {name: 'entity.name.function.mcfunction'}, - 2: {name: 'entity.name.function.mcfunction'}, - 3: {name: 'entity.name.function.mcfunction'} + applyEndPatternLast: true, + begin: '^\\s*(#[>!#])(.+)$', + beginCaptures: { + 1: {name: 'comment.block.mcfunction'}, + 2: {name: 'markup.bold.mcfunction'} }, - match: '([a-z0-9_\\.\\-]+)(\\:)([a-z0-9_\\.\\-\\/]+)' - }, - { - captures: {1: {name: 'entity.name.function.mcfunction'}}, - match: '([a-z0-9_\\.\\-\\/]+)' + captures: {0: {name: 'comment.block.mcfunction'}}, + end: '^(?!#)', + name: 'meta.comments', + patterns: [{include: '#comments_block'}] }, { - begin: '(\\[)', - beginCaptures: {1: {name: 'variable.language.mcfunction'}}, - end: '(\\])', - endCaptures: {1: {name: 'variable.language.mcfunction'}}, - patterns: [{include: '#block_predicate.arguments'}] - }, - { - begin: '(\\{)', - beginCaptures: {1: {name: 'variable.language.mcfunction'}}, - end: '(\\})', - endCaptures: {1: {name: 'variable.language.mcfunction'}}, - patterns: [{include: '#nbt.compound'}] + captures: {0: {name: 'comment.line.mcfunction'}}, + match: '^\\s*#.*$', + name: 'meta.comments' } ] }, - 'block_predicate.argument.boolean': { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: '(true|false)(?= *[\\,\\]\\n])', - name: 'meta.block_predicate.argument.boolean.mcfunction' - }, - 'block_predicate.argument.literal': { - captures: {1: {name: 'entity.name.mcfunction'}}, - match: '([a-z_][a-z0-9_]*)(?= *[\\,\\]\\n])', - name: 'meta.block_predicate.argument.literal.mcfunction' - }, - 'block_predicate.argument.number': { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: '(\\-?\\d*\\.?\\d+)(?= *[\\,\\]\\n])', - name: 'meta.block_predicate.argument.number.mcfunction' - }, - 'block_predicate.arguments': { + comments_block: { patterns: [ - {match: ' +', name: 'meta.block_predicate.argument_spacing.mcfunction'}, { - begin: '([a-z_][a-z0-9_]*) *(\\=) *', - beginCaptures: { - 1: {name: 'variable.other.mcfunction'}, - 2: {name: 'variable.language.mcfunction'} - }, - end: '(\\,)(?=[\\]\\n])|(\\,)|(?=[\\]\\n])', - endCaptures: { - 1: {name: 'invalid.illegal.mcfunction'}, - 2: {name: 'variable.language.mcfunction'} - }, - name: 'meta.block_predicate.argument.mcfunction', - patterns: [ - {include: '#block_predicate.argument.number'}, - {include: '#block_predicate.argument.boolean'}, - {include: '#block_predicate.argument.literal'} - ] + applyEndPatternLast: true, + begin: '^\\s*#[>!]', + captures: {0: {name: 'comment.block.mcfunction'}}, + end: '$', + name: 'meta.comments_block', + patterns: [{include: '#comments_block_emphasized'}] + }, + { + applyEndPatternLast: true, + begin: '^\\s*#', + captures: {0: {name: 'comment.block.mcfunction'}}, + end: '$', + name: 'meta.comments_block', + patterns: [{include: '#comments_block_normal'}] } ] }, - command: { + comments_block_emphasized: { patterns: [ + {include: '#comments_block_special'}, { - begin: '^\\s*([a-z_][a-z0-9_]*)[ \\n]', - beginCaptures: {1: {name: 'keyword.control.mcfunction'}}, - end: '$', - name: 'meta.command.mcfunction', - patterns: [ - { - begin: '(?<= )', - contentName: 'meta.command.token.mcfunction', - end: '[ \\n]', - patterns: [{include: '#command.tokens'}] - } - ] + captures: {0: {name: 'markup.bold.mcfunction'}}, + match: '\\S+', + name: 'meta.comments_block_emphasized' } ] }, - 'command.token.block_predicate': { - begin: - '(?<= )(?=(\\#)?([a-z0-9_\\.\\-]+)(\\:)([a-z0-9_\\.\\-\\/]+)(\\[|\\{))', - end: '(?=\\n)|(?:(?<=\\])(?!\\{)|(?<=\\}))([^ \\n]*)', - endCaptures: {1: {name: 'invalid.illegal.mcfunction'}}, - name: 'meta.command.token.block_predicate.mcfunction', - patterns: [{include: '#block_predicate'}] - }, - 'command.token.block_predicate_without_namespace': { - begin: - '(?<= )(?=(\\#)?([a-z0-9_\\.\\-\\/]+)(\\[ *([a-z_][a-z0-9_]*) *\\=))', - end: '(?=\\n)|(?:(?<=\\])(?!\\{)|(?<=\\}))([^ \\n]*)', - endCaptures: {1: {name: 'invalid.illegal.mcfunction'}}, - name: 'meta.command.token.block_predicate_without_namespace.mcfunction', - patterns: [{include: '#block_predicate'}] - }, - 'command.token.boolean': { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: '(?<= )(true|false)(?=[ \\n]|$)', - name: 'meta.command.token.boolean.mcfunction' - }, - 'command.token.coordinate': { - captures: { - 1: {name: 'constant.numeric.mcfunction'}, - 2: {name: 'constant.numeric.mcfunction'} - }, - match: '(?<= )([\\~\\^])(\\-?\\d*\\.?\\d+)?(?=[ \\n]|$)', - name: 'meta.command.token.coordinate.mcfunction' - }, - 'command.token.fakeplayer': { - captures: {1: {name: 'support.class.mcfunction'}}, - match: '(?<= )([\\#\\$\\%]\\S+)(?=[ \\n]|$)', - name: 'meta.command.token.fakeplayer.mcfunction' - }, - 'command.token.greedy_parent': { - captures: { - 1: {name: 'entity.name.mcfunction'}, - 2: {name: 'string.quoted.mcfunction'} - }, - match: '((?<=^say | say ))(.*)$', - name: 'meta.command.token.greedy_parent.mcfunction' - }, - 'command.token.literal': { - captures: {1: {name: 'entity.name.mcfunction'}}, - match: '(?<= )([a-z_][a-z0-9_]*)(?=[ \\n]|$)', - name: 'meta.command.token.literal.mcfunction' - }, - 'command.token.nbt_compound': { - begin: '(?<= )(\\{)', - beginCaptures: {1: {name: 'variable.language.mcfunction'}}, - end: '(?=\\n)|(\\})([^ \\n]*)', - endCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - name: 'meta.command.token.nbt_compound.mcfunction', - patterns: [{include: '#nbt.compound'}] - }, - 'command.token.nbt_list': { - begin: '(?<= )(\\[)(\\w*;)?', - beginCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'variable.language.mcfunction'} - }, - end: '(?=\\n)|(\\])([^ \\n]*)', - endCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - name: 'meta.command.token.nbt_list.mcfunction', - patterns: [{include: '#nbt.list'}] - }, - 'command.token.nbt_path': { - begin: '(?<= )(?=\\w+[\\.\\[\\{])', - end: '(?=[ \\n]|$)', - name: 'meta.command.token.nbt_path.mcfunction', - patterns: [{include: '#nbt_path.property'}] - }, - 'command.token.number': { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: '(?<= )(\\-?\\d*\\.?\\d+)(?=[ \\n]|$)', - name: 'meta.command.token.number.mcfunction' - }, - 'command.token.operation': { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: - '(?<= )(\\%\\=|\\*\\=|\\+\\=|\\-\\=|\\/\\=|\\<|\\=|\\>|\\>\\<|\\<\\=|\\>\\=)(?=[ \\n]|$)', - name: 'meta.command.token.operation.mcfunction' - }, - 'command.token.quoted_string': { - begin: '(?<= )(\\")', - beginCaptures: {1: {name: 'string.quoted.mcfunction'}}, - end: '(?=\\n)|(\\")([^ \\n]*)', - endCaptures: { - 1: {name: 'string.quoted.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - name: 'meta.command.token.quoted_string.mcfunction', - patterns: [{include: '#common.quoted_string'}] - }, - 'command.token.range': { - captures: { - 1: {name: 'constant.numeric.mcfunction'}, - 2: {name: 'keyword.control.mcfunction'}, - 3: {name: 'constant.numeric.mcfunction'} - }, - match: '(?<= )(\\-?\\d*\\.?\\d+)?(\\.\\.)(\\-?\\d*\\.?\\d+)?(?=[ \\n]|$)', - name: 'meta.command.token.range.mcfunction' - }, - 'command.token.resource_location': { - captures: { - 1: {name: 'entity.name.function.mcfunction'}, - 2: {name: 'entity.name.function.mcfunction'}, - 3: {name: 'entity.name.function.mcfunction'} - }, - match: '(?<= )([a-z0-9_\\.\\-]+)(\\:)([a-z0-9_\\.\\-\\/]+)(?=[ \\n]|$)', - name: 'meta.command.token.resource_location.mcfunction' - }, - 'command.token.root_redirect': { - captures: { - 1: {name: 'entity.name.mcfunction'}, - 2: {name: 'keyword.control.mcfunction'} - }, - match: '(?<= )(run) ([a-z_][a-z0-9_]*)?(?=[ \\n]|$)', - name: 'meta.command.token.root_redirect.mcfunction' - }, - 'command.token.selector_with_arguments': { - begin: '(?<= )(\\@[a-z])(\\[)', - beginCaptures: { - 1: {name: 'support.class.mcfunction'}, - 2: {name: 'support.class.mcfunction'} - }, - end: '(?=\\n)|(\\])([^ \\n]*)', - endCaptures: { - 1: {name: 'support.class.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - name: 'meta.command.token.selector_with_arguments.mcfunction', + comments_block_normal: { patterns: [ - {match: ' +', name: 'meta.selector.argument_spacing.mcfunction'}, + {include: '#comments_block_special'}, { - begin: - '((?:[a-z_][a-z0-9_]*)|(?:"[^"\n]*")|(?:\\\'[^\\\'\n]*\\\')) *(\\=) *(\\!)? *', - beginCaptures: { - 1: {name: 'variable.other.mcfunction'}, - 2: {name: 'support.class.mcfunction'}, - 3: {name: 'keyword.control.mcfunction'} - }, - end: '( *\\,)(?=[\\]\\n])|( *\\,)|(?= *[\\]\\n])', - endCaptures: { - 1: {name: 'invalid.illegal.mcfunction'}, - 2: {name: 'support.class.mcfunction'} - }, - name: 'meta.selector.argument.mcfunction', - patterns: [ - {include: '#selector.argument.resource_location'}, - {include: '#selector.argument.tagged_resource_location'}, - {include: '#selector.argument.range'}, - {include: '#selector.argument.number'}, - {include: '#selector.argument.boolean'}, - {include: '#selector.argument.property_map'}, - {include: '#selector.argument.nbt_compound'}, - {include: '#selector.argument.quoted_string'}, - {include: '#selector.argument.single_quoted_string'}, - {include: '#selector.argument.unquoted_string'}, - {include: '#selector.argument.unknown'} - ] + captures: {0: {name: 'comment.block.mcfunction'}}, + match: '\\S+', + name: 'meta.comments_block_normal' }, - {match: '[^\\]\\n]+', name: 'invalid.illegal.mcfunction'} + {include: '#whitespace'} ] }, - 'command.token.selector_without_arguments': { - captures: {1: {name: 'support.class.mcfunction'}}, - match: '(?<= )(\\@[a-z])(?=[ \\n]|$)', - name: 'meta.command.token.selector_without_arguments.mcfunction' - }, - 'command.token.single_quoted_string': { - begin: "(?<= )(\\')", - beginCaptures: {1: {name: 'string.quoted.mcfunction'}}, - end: "(?=\\n)|(\\')([^ \\n]*)", - endCaptures: { - 1: {name: 'string.quoted.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - name: 'meta.command.token.single_quoted_string.mcfunction', - patterns: [{include: '#common.single_quoted_string'}] - }, - 'command.token.tagged_resource_location': { - captures: { - 1: {name: 'entity.name.function.mcfunction'}, - 2: {name: 'entity.name.function.mcfunction'}, - 3: {name: 'entity.name.function.mcfunction'}, - 4: {name: 'entity.name.function.mcfunction'} - }, - match: - '(?<= )(\\#)([a-z0-9_\\.\\-]+)(\\:)([a-z0-9_\\.\\-\\/]+)(?=[ \\n]|$)', - name: 'meta.command.token.tagged_resource_location.mcfunction' - }, - 'command.token.unknown': { - captures: {1: {name: 'invalid.illegal.mcfunction'}}, - match: '(?<= )([^ \\n]*)(?=[ \\n]|$)', - name: 'meta.command.token.unknown.mcfunction' - }, - 'command.token.unquoted_string': { - captures: {1: {name: 'string.unquoted.mcfunction'}}, - match: '(?<= )(\\S+)(?=[ \\n]|$)', - name: 'meta.command.token.unquoted_string.mcfunction' - }, - 'command.token.uuid': { - captures: {1: {name: 'support.class.mcfunction'}}, - match: '(?<= )([0-9a-fA-F]+(?:(-)[0-9a-fA-F]+){4})(?=[ \\n]|$)', - name: 'meta.command.token.uuid.mcfunction' - }, - 'command.tokens': { - patterns: [ - {include: '#command.token.nbt_compound'}, - {include: '#command.token.nbt_list'}, - {include: '#command.token.selector_with_arguments'}, - {include: '#command.token.selector_without_arguments'}, - {include: '#command.token.block_predicate'}, - {include: '#command.token.block_predicate_without_namespace'}, - {include: '#command.token.resource_location'}, - {include: '#command.token.tagged_resource_location'}, - {include: '#command.token.range'}, - {include: '#command.token.number'}, - {include: '#command.token.coordinate'}, - {include: '#command.token.boolean'}, - {include: '#command.token.operation'}, - {include: '#command.token.root_redirect'}, - {include: '#command.token.greedy_parent'}, - {include: '#command.token.literal'}, - {include: '#command.token.uuid'}, - {include: '#command.token.fakeplayer'}, - {include: '#command.token.nbt_path'}, - {include: '#command.token.quoted_string'}, - {include: '#command.token.single_quoted_string'}, - {include: '#command.token.unquoted_string'}, - {include: '#command.token.unknown'} - ] - }, - comment: { + comments_block_special: { patterns: [ { - begin: '^[ \\t]*((#)([\\#\\>\\~\\!\\@\\$\\%\\^\\*]+)((.*)))$', - beginCaptures: { - 1: {name: 'comment.block.mcfunction'}, - 2: {name: 'markup.list.mcfunction'}, - 3: {name: 'markup.list.mcfunction'}, - 4: {name: 'markup.bold.mcfunction'}, - 5: {name: 'markup.list.mcfunction'} - }, - end: '^(?![ \\t]*#)', - name: 'meta.comment.block.mcfunction', - patterns: [{include: '#comment.block'}] + captures: {0: {name: 'markup.heading.mcfunction'}}, + match: '@\\S+', + name: 'meta.comments_block_special' }, + {include: '#resource-name'}, { - captures: {1: {name: 'comment.line.mcfunction'}}, - match: '^[ \\t]*(#.*)$', - name: 'meta.comment.line.mcfunction' + captures: {0: {name: 'variable.other.mcfunction'}}, + match: '[#%$][A-Za-z0-9_.#%$]+', + name: 'meta.comments_block_special' } ] }, - 'comment.block': { + comments_inline: { patterns: [ { - begin: '^[ \\t]*((#)[ \\t]*)', - beginCaptures: { - 1: {name: 'comment.block.mcfunction'}, - 2: {name: 'markup.list.mcfunction'} - }, - end: '$', - name: 'meta.comment.block_line.mcfunction', - patterns: [{include: '#comment.block.line'}] + captures: {0: {name: 'comment.line.mcfunction'}}, + match: '#.*$', + name: 'meta.comments' } ] }, - 'comment.block.line': { + literals: { patterns: [ { - captures: { - 1: {name: 'comment.block.mcfunction'}, - 2: {name: 'markup.heading.mcfunction'}, - 3: {name: 'comment.block.mcfunction'} - }, - match: '((\\@\\w*)\\b(.*))$', - name: 'meta.comment.block.annotation.mcfunction' + captures: {0: {name: 'constant.numeric.boolean.mcfunction'}}, + match: '\\b(true|false|True|False)\\b', + name: 'meta.literals' }, { - captures: { - 1: {name: 'comment.block.mcfunction'}, - 2: {name: 'markup.list.mcfunction'}, - 3: {name: 'markup.bold.mcfunction'}, - 4: {name: 'markup.list.mcfunction'} + captures: {0: {name: 'variable.uuid.mcfunction'}}, + match: '\\b[0-9a-fA-F]+(?:-[0-9a-fA-F]+){4}\\b', + name: 'meta.names' + }, + { + captures: {0: {name: 'constant.numeric.float.mcfunction'}}, + match: '[+-]?\\d*\\.?\\d+([eE]?[+-]?\\d+)?[df]?\\b', + name: 'meta.literals' + }, + { + captures: {0: {name: 'constant.numeric.integer.mcfunction'}}, + match: '[+-]?\\d+(b|B|L|l|s|S)?\\b', + name: 'meta.literals' + }, + { + captures: {0: {name: 'variable.other.mcfunction'}}, + match: '\\.\\.', + name: 'meta.ellipse.literals' + }, + { + applyEndPatternLast: true, + begin: '"', + beginCaptures: { + 0: {name: 'punctuation.definition.string.begin.mcfunction'} + }, + end: '"', + endCaptures: { + 0: {name: 'punctuation.definition.string.end.mcfunction'} }, - match: '(([\\#\\>\\~\\!\\@\\$\\%\\^\\*]+)((.*)))$', - name: 'meta.comment.block.heading.mcfunction' + name: 'string.quoted.double.mcfunction', + patterns: [{include: '#literals_string-double'}] }, { - captures: {1: {name: 'comment.block.mcfunction'}}, - match: '(.*)$', - name: 'meta.comment.block.text.mcfunction' + applyEndPatternLast: true, + begin: "'", + beginCaptures: { + 0: {name: 'punctuation.definition.string.begin.mcfunction'} + }, + end: "'", + endCaptures: { + 0: {name: 'punctuation.definition.string.begin.mcfunction'} + }, + name: 'string.quoted.single.mcfunction', + patterns: [{include: '#literals_string-single'}] } ] }, - 'common.quoted_string': { - patterns: [ - {match: '[^\\\\\\"\\n]', name: 'string.quoted.mcfunction'}, - {match: '\\\\[^\\n]', name: 'constant.character.escape.mcfunction'}, - {match: '\\\\', name: 'invalid.illegal.mcfunction'} - ] - }, - 'common.single_quoted_string': { + 'literals_string-double': { patterns: [ - {match: "[^\\\\\\'\\n]", name: 'string.quoted.mcfunction'}, - {match: '\\\\[^\\n]', name: 'constant.character.escape.mcfunction'}, - {match: '\\\\', name: 'invalid.illegal.mcfunction'} + { + captures: {0: {name: 'constant.character.escape.mcfunction'}}, + match: '\\\\.', + name: 'meta.literals_string-double' + }, + { + captures: {0: {name: 'constant.character.escape.mcfunction'}}, + match: '\\\\', + name: 'meta.literals_string-double' + }, + {include: '#macro-name'}, + { + captures: {0: {name: 'string.quoted.double.mcfunction'}}, + match: '[^\\\\"]', + name: 'meta.literals_string-double' + } ] }, - 'nbt.compound': { + 'literals_string-single': { patterns: [ - {match: ' +'}, { - begin: '(,)? *([A-Za-z0-9_\\.\\-]+|\\"[^\\n\\"]+\\") *(\\:) *', - beginCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'string.interpolated.mcfunction'}, - 3: {name: 'variable.language.mcfunction'} - }, - end: ' *(?=[\\n\\}\\,])', - patterns: [{include: '#nbt.value'}] + captures: {0: {name: 'constant.character.escape.mcfunction'}}, + match: '\\\\.', + name: 'meta.literals_string-single' + }, + { + captures: {0: {name: 'constant.character.escape.mcfunction'}}, + match: '\\\\', + name: 'meta.literals_string-double' }, - {match: '[^\\n\\}\\,]+', name: 'invalid.illegal.mcfunction'} + {include: '#macro-name'}, + { + captures: {0: {name: 'string.quoted.single.mcfunction'}}, + match: "[^\\\\']", + name: 'meta.literals_string-single' + } ] }, - 'nbt.list': { + 'macro-name': { patterns: [ - {match: ' +'}, { - begin: '(,)? *(?=[^\\n\\]\\,])', - beginCaptures: {1: {name: 'variable.language.mcfunction'}}, - end: ' *(?=[\\n\\]\\,])', - patterns: [{include: '#nbt.value'}] - }, - {match: '[^\\n\\]\\,]+', name: 'invalid.illegal.mcfunction'} + captures: { + 1: { + name: 'punctuation.definition.template-expression.begin.mcfunction' + }, + 2: {name: 'variable.other.mcfunction'}, + 3: { + name: 'punctuation.definition.template-expression.end.mcfunction' + } + }, + match: '(\\$\\()([A-Za-z0-9_]*)(\\))', + name: 'meta.macro-name' + } ] }, - 'nbt.value': { + names: { patterns: [ { - begin: '(\\{)', - beginCaptures: {1: {name: 'variable.language.mcfunction'}}, - end: '(?=\\n)|(\\})', - endCaptures: {1: {name: 'variable.language.mcfunction'}}, - patterns: [{include: '#nbt.compound'}] + captures: { + 1: {name: 'whitespace.mcfunction'}, + 2: {name: 'keyword.control.flow.mcfunction'} + }, + match: '^(\\s*)([a-z_]+)(?=\\s)', + name: 'meta.names' }, { - begin: '(\\[)(\\w*;)?', - beginCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'variable.language.mcfunction'} + captures: { + 1: {name: 'whitespace.mcfunction'}, + 2: {name: 'markup.italic.mcfunction'}, + 3: {name: 'whitespace.mcfunction'}, + 4: {name: 'keyword.control.flow.mcfunction'} }, - end: '(?=\\n)|(\\])', - endCaptures: {1: {name: 'variable.language.mcfunction'}}, - patterns: [{include: '#nbt.list'}] + match: '^(\\s*)(\\$)( ?)([a-z_]*)', + name: 'meta.names' }, { - begin: '(\\")', - beginCaptures: {1: {name: 'string.quoted.mcfunction'}}, - end: '(?=\\n)|(\\")', - endCaptures: {1: {name: 'string.quoted.mcfunction'}}, - patterns: [{include: '#common.quoted_string'}] + captures: { + 1: {name: 'entity.name.mcfunction'}, + 2: {name: 'whitespace.mcfunction'}, + 3: {name: 'keyword.control.flow.mcfunction'} + }, + match: '(run)(\\s+)([a-z_]+)', + name: 'meta.names' }, + {include: '#resource-name'}, { - begin: "(\\')", - beginCaptures: {1: {name: 'string.quoted.mcfunction'}}, - end: "(?=\\n)|(\\')", - endCaptures: {1: {name: 'string.quoted.mcfunction'}}, - patterns: [{include: '#common.single_quoted_string'}] + captures: {0: {name: 'entity.name.mcfunction'}}, + match: '[A-Za-z]+(?=\\W)', + name: 'meta.names' }, - {match: '(true|false)', name: 'constant.numeric.mcfunction'}, - {match: '(\\-?\\d*\\.?\\d+)', name: 'constant.numeric.mcfunction'}, { - match: '([^\\s\\{\\}\\[\\]\\,\\:\\=]+)', - name: 'string.unquoted.mcfunction' + captures: {0: {name: 'string.unquoted.mcfunction'}}, + match: '[A-Za-z_][A-Za-z0-9_.#%$]*', + name: 'meta.names' }, - {match: '[^\\n\\,\\]\\}]+', name: 'invalid.illegal.mcfunction'} + {include: '#macro-name'}, + { + captures: {0: {name: 'variable.other.mcfunction'}}, + match: '([#%$]|((?<=\\s)\\.))[A-Za-z0-9_.#%$\\-]+', + name: 'meta.names' + } ] }, - 'nbt_path.index': { + operators: { patterns: [ { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: '(?<=\\[)(\\-?\\d+)(?=\\])' + captures: {0: {name: 'constant.numeric.mcfunction'}}, + match: '[~^]', + name: 'meta.operators' }, { - begin: '(\\{)', - beginCaptures: {1: {name: 'variable.language.mcfunction'}}, - end: '(?=\\n)|(\\})([^\\]\\,\\n]*)', - endCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - patterns: [{include: '#nbt.compound'}] - }, - {match: '[^\\n\\]]+', name: 'invalid.illegal.mcfunction'} + captures: {0: {name: 'keyword.operator.mcfunction'}}, + match: '[\\-%?!+*<>\\\\/|&=.:,;]', + name: 'meta.operators' + } ] }, - 'nbt_path.property': { + property: { patterns: [ { - begin: '(\\.)?(\\w+)?(\\[)', - beginCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'string.interpolated.mcfunction'}, - 3: {name: 'variable.language.mcfunction'} - }, - end: '(\\])|(?=\\n)', - endCaptures: {1: {name: 'variable.language.mcfunction'}}, - patterns: [{include: '#nbt_path.index'}] + applyEndPatternLast: true, + begin: '\\{', + captures: {0: {name: 'punctuation.mcfunction'}}, + end: '\\}', + name: 'meta.property.curly', + patterns: [ + {include: '#resource-name'}, + {include: '#literals'}, + {include: '#property_key'}, + {include: '#operators'}, + {include: '#property_value'}, + {include: '$self'} + ] }, { - begin: '(\\.)?(\\w+)(\\{)', - beginCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'string.interpolated.mcfunction'}, - 3: {name: 'variable.language.mcfunction'} - }, - end: '(\\})|(?=\\n)', - endCaptures: {1: {name: 'variable.language.mcfunction'}}, - patterns: [{include: '#nbt.compound'}] + applyEndPatternLast: true, + begin: '\\[', + captures: {0: {name: 'variable.other.mcfunction'}}, + end: '\\]', + name: 'meta.property.square', + patterns: [ + {include: '#resource-name'}, + {include: '#literals'}, + {include: '#property_key'}, + {include: '#operators'}, + {include: '#property_value'}, + {include: '$self'} + ] }, { - begin: '(\\")', - beginCaptures: {1: {name: 'string.quoted.mcfunction'}}, - end: '(?=\\n)|(\\")([^\\. \\n]*)', - endCaptures: { - 1: {name: 'string.quoted.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - patterns: [{include: '#common.quoted_string'}] - }, + applyEndPatternLast: true, + begin: '\\(', + captures: {0: {name: 'punctuation.mcfunction'}}, + end: '\\)', + name: 'meta.property.paren', + patterns: [ + {include: '#resource-name'}, + {include: '#literals'}, + {include: '#property_key'}, + {include: '#operators'}, + {include: '#property_value'}, + {include: '$self'} + ] + } + ] + }, + property_key: { + patterns: [ { - captures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'string.interpolated.mcfunction'} - }, - match: '(\\.)?(\\w+)' + captures: {0: {name: 'variable.other.mcfunction'}}, + match: '#?[a-z_][a-z_\\.\\-]*\\:[a-z0-9_\\.\\-/]+(?=\\s*\\=:)', + name: 'meta.property_key' }, { - captures: {1: {name: 'invalid.illegal.mcfunction'}}, - match: '(\\.)(?=\\.)' + captures: {0: {name: 'variable.other.mcfunction'}}, + match: '#?[a-z_][a-z0-9_\\.\\-/]+', + name: 'meta.property_key' }, - {match: '[^\\.\\s]+', name: 'invalid.illegal.mcfunction'} + { + captures: {0: {name: 'variable.other.mcfunction'}}, + match: '[A-Za-z_]+[A-Za-z_\\-\\+]*', + name: 'meta.property_key' + } ] }, - property_map: { + property_value: { patterns: [ - {match: ' +'}, { - begin: '(,)? *([A-Za-z0-9_\\.\\-]+) *(\\=) *', - beginCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'entity.name.function.mcfunction'}, - 3: {name: 'variable.language.mcfunction'} - }, - end: ' *(?=[\\n\\}\\,])', - patterns: [{include: '#property_map.values'}] + captures: {0: {name: 'string.unquoted.mcfunction'}}, + match: '#?[a-z_][a-z_\\.\\-]*\\:[a-z0-9_\\.\\-/]+', + name: 'meta.property_value' }, { - begin: - '(,)? *([a-z0-9_\\.\\-]+\\:[a-z0-9_\\.\\-\\/]+|[a-z0-9_\\.\\-\\/]+) *(\\=) *', - beginCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'entity.name.function.mcfunction'}, - 3: {name: 'variable.language.mcfunction'} - }, - end: ' *(?=[\\n\\}\\,])', - patterns: [{include: '#property_map.values'}] - }, - {match: '[^\\n\\}\\,]+', name: 'invalid.illegal.mcfunction'} + captures: {0: {name: 'string.unquoted.mcfunction'}}, + match: '#?[a-z_][a-z0-9_\\.\\-/]+', + name: 'meta.property_value' + } ] }, - 'property_map.values': { + 'resource-name': { patterns: [ { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: '(true|false)' + captures: {0: {name: 'entity.name.function.mcfunction'}}, + match: '#?[a-z_][a-z0-9_.-]*:[a-z0-9_./-]+', + name: 'meta.resource-name' }, { - captures: { - 1: {name: 'constant.numeric.mcfunction'}, - 2: {name: 'keyword.control.mcfunction'}, - 3: {name: 'constant.numeric.mcfunction'} - }, - match: '(\\-?\\d*\\.?\\d+)?(\\.\\.)(\\-?\\d*\\.?\\d+)?' - }, + captures: {0: {name: 'entity.name.function.mcfunction'}}, + match: '#?[a-z0-9_\\.\\-]+\\/[a-z0-9_\\.\\-\\/]+', + name: 'meta.resource-name' + } + ] + }, + root: { + patterns: [ + {include: '#literals'}, + {include: '#comments'}, + {include: '#say'}, + {include: '#names'}, + {include: '#comments_inline'}, + {include: '#subcommands'}, + {include: '#property'}, + {include: '#operators'}, + {include: '#selectors'} + ] + }, + say: { + patterns: [ { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: '(\\-?\\d*\\.?\\d+)' + begin: '^(\\s*)(say)', + beginCaptures: { + 1: {name: 'whitespace.mcfunction'}, + 2: {name: 'keyword.control.flow.mcfunction'} + }, + end: '\\n', + name: 'meta.say.mcfunction', + patterns: [ + { + captures: {0: {name: 'constant.character.escape.mcfunction'}}, + match: '\\\\\\s*\\n' + }, + {include: '#literals_string-double'}, + {include: '#literals_string-single'} + ] }, { - begin: '(\\{) *', - beginCaptures: {1: {name: 'variable.language.mcfunction'}}, - end: '(?=\\n)|(\\}) *([^\\}\\,\\n]*)', - endCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} + begin: '(run)(\\s+)(say)', + beginCaptures: { + 1: {name: 'entity.name.mcfunction'}, + 2: {name: 'whitespace.mcfunction'}, + 3: {name: 'keyword.control.flow.mcfunction'} }, - patterns: [{include: '#property_map'}] + end: '\\n', + name: 'meta.say.mcfunction', + patterns: [ + { + captures: {0: {name: 'constant.character.escape.mcfunction'}}, + match: '\\\\\\s*\\n' + }, + {include: '#literals_string-double'}, + {include: '#literals_string-single'} + ] } ] }, - 'selector.argument.boolean': { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: '(true|false)(?= *[\\,\\]\\n])', - name: 'meta.selector.argument.boolean.mcfunction' - }, - 'selector.argument.nbt_compound': { - begin: '(\\{)', - beginCaptures: {1: {name: 'variable.language.mcfunction'}}, - end: '(?=\\n)|(\\}) *([^\\]\\,\\n]*)', - endCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - name: 'meta.selector.argument.nbt_compound.mcfunction', - patterns: [{include: '#nbt.compound'}] - }, - 'selector.argument.number': { - captures: {1: {name: 'constant.numeric.mcfunction'}}, - match: '(\\-?\\d*\\.?\\d+)(?= *[\\,\\]\\n])', - name: 'meta.selector.argument.number.mcfunction' - }, - 'selector.argument.property_map': { - begin: - '(\\{)(?= *([a-z0-9_\\.\\-]+\\:[a-z0-9_\\.\\-\\/]+|[a-z0-9_\\.\\-\\/]+|([A-Za-z0-9_\\.\\-]+)) *(\\=))', - beginCaptures: {1: {name: 'variable.language.mcfunction'}}, - end: '(?=\\n)|(\\}) *([^\\]\\,\\n]*)', - endCaptures: { - 1: {name: 'variable.language.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - name: 'meta.selector.argument.property_map.mcfunction', - patterns: [{include: '#property_map'}] - }, - 'selector.argument.quoted_string': { - begin: '(\\")', - beginCaptures: {1: {name: 'string.quoted.mcfunction'}}, - end: '(?=\\n)|(\\") *([^\\]\\,\\n]*)', - endCaptures: { - 1: {name: 'string.quoted.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - name: 'meta.selector.argument.quoted_string.mcfunction', - patterns: [{include: '#common.quoted_string'}] - }, - 'selector.argument.range': { - captures: { - 1: {name: 'constant.numeric.mcfunction'}, - 2: {name: 'keyword.control.mcfunction'}, - 3: {name: 'constant.numeric.mcfunction'} - }, - match: '(\\-?\\d*\\.?\\d+)?(\\.\\.)(\\-?\\d*\\.?\\d+)?(?= *[\\,\\]\\n])', - name: 'meta.selector.argument.range.mcfunction' - }, - 'selector.argument.resource_location': { - captures: { - 1: {name: 'entity.name.function.mcfunction'}, - 2: {name: 'entity.name.function.mcfunction'}, - 3: {name: 'entity.name.function.mcfunction'} - }, - match: '([a-z0-9_\\.\\-]+)(\\:)([a-z0-9_\\.\\-\\/]+)(?= *[\\,\\]\\n])', - name: 'meta.selector.argument.resource_location.mcfunction' - }, - 'selector.argument.single_quoted_string': { - begin: "(\\')", - beginCaptures: {1: {name: 'string.quoted.mcfunction'}}, - end: "(?=\\n)|(\\') *([^\\]\\,\\n]*)", - endCaptures: { - 1: {name: 'string.quoted.mcfunction'}, - 2: {name: 'invalid.illegal.mcfunction'} - }, - name: 'meta.selector.argument.single_quoted_string.mcfunction', - patterns: [{include: '#common.single_quoted_string'}] - }, - 'selector.argument.tagged_resource_location': { - captures: { - 1: {name: 'entity.name.function.mcfunction'}, - 2: {name: 'entity.name.function.mcfunction'}, - 3: {name: 'entity.name.function.mcfunction'}, - 4: {name: 'entity.name.function.mcfunction'} - }, - match: - '(\\#)([a-z0-9_\\.\\-]+)(\\:)([a-z0-9_\\.\\-\\/]+)(?= *[\\,\\]\\n])', - name: 'meta.selector.argument.tagged_resource_location.mcfunction' - }, - 'selector.argument.unknown': { - captures: {1: {name: 'invalid.illegal.mcfunction'}}, - match: '([^\\]\\n\\,]+)', - name: 'meta.selector.argument.unknown.mcfunction' - }, - 'selector.argument.unquoted_string': { - captures: {1: {name: 'string.unquoted.mcfunction'}}, - match: '([^\\s\\{\\}\\[\\]\\,\\:\\=\\!]+)(?= *[\\,\\]\\n])', - name: 'meta.selector.argument.unquoted_string.mcfunction' + selectors: { + patterns: [ + { + captures: {0: {name: 'support.class.mcfunction'}}, + match: '@[a-z]+', + name: 'meta.selectors' + } + ] }, - unknown: { + subcommands: { patterns: [ { - captures: {1: {name: 'invalid.illegal.mcfunction'}}, - match: '^(.*)$', - name: 'meta.unknown.mcfunction' + captures: {0: {name: 'entity.name.class.mcfunction'}}, + match: '[a-z_]+', + name: 'meta.literals' } ] } diff --git a/lang/source.mdx.js b/lang/source.mdx.js index a2f9114..d913837 100644 --- a/lang/source.mdx.js +++ b/lang/source.mdx.js @@ -169,11 +169,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.apib', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.apib.mdx', - patterns: [{include: 'text.html.markdown.source.gfm.apib'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.apib', + patterns: [{include: 'text.html.markdown.source.gfm.apib'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -186,11 +192,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.apib', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.apib.mdx', - patterns: [{include: 'text.html.markdown.source.gfm.apib'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.apib', + patterns: [{include: 'text.html.markdown.source.gfm.apib'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -207,11 +219,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.asciidoc', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.asciidoc.mdx', - patterns: [{include: 'text.html.asciidoc'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.asciidoc', + patterns: [{include: 'text.html.asciidoc'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -224,11 +242,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.asciidoc', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.asciidoc.mdx', - patterns: [{include: 'text.html.asciidoc'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.asciidoc', + patterns: [{include: 'text.html.asciidoc'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -245,11 +269,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.c', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.c.mdx', - patterns: [{include: 'source.c'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.c', + patterns: [{include: 'source.c'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -262,11 +292,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.c', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.c.mdx', - patterns: [{include: 'source.c'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.c', + patterns: [{include: 'source.c'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -283,11 +319,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.clojure', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.clojure.mdx', - patterns: [{include: 'source.clojure'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.clojure', + patterns: [{include: 'source.clojure'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -300,11 +342,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.clojure', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.clojure.mdx', - patterns: [{include: 'source.clojure'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.clojure', + patterns: [{include: 'source.clojure'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -321,11 +369,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.coffee', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.coffee.mdx', - patterns: [{include: 'source.coffee'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.coffee', + patterns: [{include: 'source.coffee'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -338,11 +392,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.coffee', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.coffee.mdx', - patterns: [{include: 'source.coffee'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.coffee', + patterns: [{include: 'source.coffee'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -359,11 +419,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.console', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.console.mdx', - patterns: [{include: 'text.python.console'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.console', + patterns: [{include: 'text.python.console'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -376,11 +442,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.console', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.console.mdx', - patterns: [{include: 'text.python.console'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.console', + patterns: [{include: 'text.python.console'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -397,11 +469,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.cpp', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.cpp.mdx', - patterns: [{include: 'source.c++'}, {include: 'source.c++'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.cpp', + patterns: [{include: 'source.c++'}, {include: 'source.c++'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -414,11 +492,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.cpp', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.cpp.mdx', - patterns: [{include: 'source.c++'}, {include: 'source.c++'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.cpp', + patterns: [{include: 'source.c++'}, {include: 'source.c++'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -426,7 +510,7 @@ const grammar = { patterns: [ { begin: - '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:beef|c#|cakescript|csharp|(?:.*\\.)?(?:bf|cake|cs|csx|eq|linq|uno)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:beef|c#|cakescript|csharp|(?:.*\\.)?(?:bf|cake|cs|cs\\.pp|csx|eq|linq|uno)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -435,15 +519,21 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.cs', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.cs.mdx', - patterns: [{include: 'source.cs'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.cs', + patterns: [{include: 'source.cs'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: - '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:beef|c#|cakescript|csharp|(?:.*\\.)?(?:bf|cake|cs|csx|eq|linq|uno)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:beef|c#|cakescript|csharp|(?:.*\\.)?(?:bf|cake|cs|cs\\.pp|csx|eq|linq|uno)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -452,11 +542,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.cs', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.cs.mdx', - patterns: [{include: 'source.cs'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.cs', + patterns: [{include: 'source.cs'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -473,11 +569,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.css', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.css.mdx', - patterns: [{include: 'source.css'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.css', + patterns: [{include: 'source.css'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -490,11 +592,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.css', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.css.mdx', - patterns: [{include: 'source.css'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.css', + patterns: [{include: 'source.css'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -511,11 +619,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.diff', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.diff.mdx', - patterns: [{include: 'source.diff'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.diff', + patterns: [{include: 'source.diff'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -528,11 +642,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.diff', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.diff.mdx', - patterns: [{include: 'source.diff'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.diff', + patterns: [{include: 'source.diff'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -549,11 +669,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.dockerfile', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.dockerfile.mdx', - patterns: [{include: 'source.dockerfile'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.dockerfile', + patterns: [{include: 'source.dockerfile'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -566,11 +692,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.dockerfile', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.dockerfile.mdx', - patterns: [{include: 'source.dockerfile'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.dockerfile', + patterns: [{include: 'source.dockerfile'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -587,11 +719,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.elixir', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.elixir.mdx', - patterns: [{include: 'source.elixir'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.elixir', + patterns: [{include: 'source.elixir'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -604,11 +742,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.elixir', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.elixir.mdx', - patterns: [{include: 'source.elixir'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.elixir', + patterns: [{include: 'source.elixir'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -625,11 +769,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.elm', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.elm.mdx', - patterns: [{include: 'source.elm'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.elm', + patterns: [{include: 'source.elm'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -642,11 +792,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.elm', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.elm.mdx', - patterns: [{include: 'source.elm'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.elm', + patterns: [{include: 'source.elm'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -663,11 +819,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.erlang', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.erlang.mdx', - patterns: [{include: 'source.erlang'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.erlang', + patterns: [{include: 'source.erlang'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -680,11 +842,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.erlang', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.erlang.mdx', - patterns: [{include: 'source.erlang'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.erlang', + patterns: [{include: 'source.erlang'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -701,11 +869,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.gitconfig', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.gitconfig.mdx', - patterns: [{include: 'source.gitconfig'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.gitconfig', + patterns: [{include: 'source.gitconfig'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -718,11 +892,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.gitconfig', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.gitconfig.mdx', - patterns: [{include: 'source.gitconfig'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.gitconfig', + patterns: [{include: 'source.gitconfig'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -739,11 +919,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.go', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.go.mdx', - patterns: [{include: 'source.go'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.go', + patterns: [{include: 'source.go'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -756,11 +942,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.go', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.go.mdx', - patterns: [{include: 'source.go'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.go', + patterns: [{include: 'source.go'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -777,11 +969,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.graphql', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.graphql.mdx', - patterns: [{include: 'source.graphql'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.graphql', + patterns: [{include: 'source.graphql'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -794,11 +992,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.graphql', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.graphql.mdx', - patterns: [{include: 'source.graphql'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.graphql', + patterns: [{include: 'source.graphql'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -806,7 +1010,7 @@ const grammar = { patterns: [ { begin: - '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:bh|bluespec\\x2dbh|bluespec\\x2dclassic|c2hs|c2hs\\x2dhaskell|frege|haskell|(?:.*\\.)?(?:chs|dhall|hs|hs\\x2dboot|hsc)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:c2hs|c2hs\\x2dhaskell|frege|haskell|(?:.*\\.)?(?:chs|dhall|hs|hs\\x2dboot|hsc)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -815,15 +1019,21 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.haskell', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.haskell.mdx', - patterns: [{include: 'source.haskell'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.haskell', + patterns: [{include: 'source.haskell'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: - '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:bh|bluespec\\x2dbh|bluespec\\x2dclassic|c2hs|c2hs\\x2dhaskell|frege|haskell|(?:.*\\.)?(?:chs|dhall|hs|hs\\x2dboot|hsc)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:c2hs|c2hs\\x2dhaskell|frege|haskell|(?:.*\\.)?(?:chs|dhall|hs|hs\\x2dboot|hsc)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -832,11 +1042,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.haskell', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.haskell.mdx', - patterns: [{include: 'source.haskell'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.haskell', + patterns: [{include: 'source.haskell'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -853,11 +1069,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.html', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.html.mdx', - patterns: [{include: 'text.html.basic'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.html', + patterns: [{include: 'text.html.basic'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -870,11 +1092,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.html', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.html.mdx', - patterns: [{include: 'text.html.basic'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.html', + patterns: [{include: 'text.html.basic'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -891,11 +1119,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.ini', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.ini.mdx', - patterns: [{include: 'source.ini'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.ini', + patterns: [{include: 'source.ini'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -908,11 +1142,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.ini', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.ini.mdx', - patterns: [{include: 'source.ini'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.ini', + patterns: [{include: 'source.ini'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -929,11 +1169,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.java', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.java.mdx', - patterns: [{include: 'source.java'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.java', + patterns: [{include: 'source.java'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -946,11 +1192,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.java', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.java.mdx', - patterns: [{include: 'source.java'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.java', + patterns: [{include: 'source.java'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -958,7 +1210,7 @@ const grammar = { patterns: [ { begin: - '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:cycript|javascript\\+erb|json\\x2dwith\\x2dcomments|node|qt\\x2dscript|(?:.*\\.)?(?:_js|bones|cjs|code\\x2dsnippets|code\\x2dworkspace|cy|es6|jake|javascript|js|js\\.erb|jsb|jscad|jsfl|jslib|jsm|json5|jsonc|jsonld|jspre|jss|jsx|mjs|njs|pac|sjs|ssjs|sublime\\x2dbuild|sublime\\x2dcommands|sublime\\x2dcompletions|sublime\\x2dkeymap|sublime\\x2dmacro|sublime\\x2dmenu|sublime\\x2dmousemap|sublime\\x2dproject|sublime\\x2dsettings|sublime\\x2dtheme|sublime\\x2dworkspace|sublime_metrics|sublime_session|xsjs|xsjslib)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:cycript|javascript\\+erb|json\\x2dwith\\x2dcomments|node|qt\\x2dscript|(?:.*\\.)?(?:_js|bones|cjs|code\\x2dsnippets|code\\x2dworkspace|cy|es6|jake|javascript|js|js\\.erb|jsb|jscad|jsfl|jslib|jsm|json5|jsonc|jsonld|jspre|jss|jsx|mjs|njs|pac|sjs|ssjs|sublime\\x2dbuild|sublime\\x2dcolor\\x2dscheme|sublime\\x2dcommands|sublime\\x2dcompletions|sublime\\x2dkeymap|sublime\\x2dmacro|sublime\\x2dmenu|sublime\\x2dmousemap|sublime\\x2dproject|sublime\\x2dsettings|sublime\\x2dtheme|sublime\\x2dworkspace|sublime_metrics|sublime_session|xsjs|xsjslib)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -967,15 +1219,21 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.js', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.js.mdx', - patterns: [{include: 'source.js'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.js', + patterns: [{include: 'source.js'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: - '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:cycript|javascript\\+erb|json\\x2dwith\\x2dcomments|node|qt\\x2dscript|(?:.*\\.)?(?:_js|bones|cjs|code\\x2dsnippets|code\\x2dworkspace|cy|es6|jake|javascript|js|js\\.erb|jsb|jscad|jsfl|jslib|jsm|json5|jsonc|jsonld|jspre|jss|jsx|mjs|njs|pac|sjs|ssjs|sublime\\x2dbuild|sublime\\x2dcommands|sublime\\x2dcompletions|sublime\\x2dkeymap|sublime\\x2dmacro|sublime\\x2dmenu|sublime\\x2dmousemap|sublime\\x2dproject|sublime\\x2dsettings|sublime\\x2dtheme|sublime\\x2dworkspace|sublime_metrics|sublime_session|xsjs|xsjslib)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:cycript|javascript\\+erb|json\\x2dwith\\x2dcomments|node|qt\\x2dscript|(?:.*\\.)?(?:_js|bones|cjs|code\\x2dsnippets|code\\x2dworkspace|cy|es6|jake|javascript|js|js\\.erb|jsb|jscad|jsfl|jslib|jsm|json5|jsonc|jsonld|jspre|jss|jsx|mjs|njs|pac|sjs|ssjs|sublime\\x2dbuild|sublime\\x2dcolor\\x2dscheme|sublime\\x2dcommands|sublime\\x2dcompletions|sublime\\x2dkeymap|sublime\\x2dmacro|sublime\\x2dmenu|sublime\\x2dmousemap|sublime\\x2dproject|sublime\\x2dsettings|sublime\\x2dtheme|sublime\\x2dworkspace|sublime_metrics|sublime_session|xsjs|xsjslib)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -984,11 +1242,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.js', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.js.mdx', - patterns: [{include: 'source.js'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.js', + patterns: [{include: 'source.js'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -996,7 +1260,7 @@ const grammar = { patterns: [ { begin: - '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:ecere\\x2dprojects|ipython\\x2dnotebook|jupyter\\x2dnotebook|max|max/msp|maxmsp|oasv2\\x2djson|oasv3\\x2djson|(?:.*\\.)?(?:4dform|4dproject|avsc|epj|geojson|gltf|har|ice|ipynb|json|json|json|json\\x2dtmlanguage|jsonl|maxhelp|maxpat|maxproj|mcmeta|mxt|pat|tfstate|tfstate\\.backup|topojson|webapp|webmanifest|yy|yyp)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:ecere\\x2dprojects|ipython\\x2dnotebook|jupyter\\x2dnotebook|max|max/msp|maxmsp|oasv2\\x2djson|oasv3\\x2djson|(?:.*\\.)?(?:4dform|4dproject|avsc|epj|geojson|gltf|har|ice|ipynb|json|json|json|json\\x2dtmlanguage|jsonl|maxhelp|maxpat|maxproj|mcmeta|mxt|pat|sarif|tfstate|tfstate\\.backup|topojson|webapp|webmanifest|yy|yyp)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -1005,15 +1269,21 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.json', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.json.mdx', - patterns: [{include: 'source.json'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.json', + patterns: [{include: 'source.json'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: - '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:ecere\\x2dprojects|ipython\\x2dnotebook|jupyter\\x2dnotebook|max|max/msp|maxmsp|oasv2\\x2djson|oasv3\\x2djson|(?:.*\\.)?(?:4dform|4dproject|avsc|epj|geojson|gltf|har|ice|ipynb|json|json|json|json\\x2dtmlanguage|jsonl|maxhelp|maxpat|maxproj|mcmeta|mxt|pat|tfstate|tfstate\\.backup|topojson|webapp|webmanifest|yy|yyp)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:ecere\\x2dprojects|ipython\\x2dnotebook|jupyter\\x2dnotebook|max|max/msp|maxmsp|oasv2\\x2djson|oasv3\\x2djson|(?:.*\\.)?(?:4dform|4dproject|avsc|epj|geojson|gltf|har|ice|ipynb|json|json|json|json\\x2dtmlanguage|jsonl|maxhelp|maxpat|maxproj|mcmeta|mxt|pat|sarif|tfstate|tfstate\\.backup|topojson|webapp|webmanifest|yy|yyp)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -1022,11 +1292,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.json', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.json.mdx', - patterns: [{include: 'source.json'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.json', + patterns: [{include: 'source.json'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1043,11 +1319,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.julia', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.julia.mdx', - patterns: [{include: 'source.julia'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.julia', + patterns: [{include: 'source.julia'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1060,11 +1342,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.julia', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.julia.mdx', - patterns: [{include: 'source.julia'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.julia', + patterns: [{include: 'source.julia'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1081,11 +1369,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.kotlin', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.kotlin.mdx', - patterns: [{include: 'source.kotlin'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.kotlin', + patterns: [{include: 'source.kotlin'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1098,11 +1392,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.kotlin', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.kotlin.mdx', - patterns: [{include: 'source.kotlin'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.kotlin', + patterns: [{include: 'source.kotlin'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1119,11 +1419,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.less', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.less.mdx', - patterns: [{include: 'source.css.less'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.less', + patterns: [{include: 'source.css.less'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1136,11 +1442,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.less', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.less.mdx', - patterns: [{include: 'source.css.less'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.less', + patterns: [{include: 'source.css.less'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1157,11 +1469,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.lua', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.lua.mdx', - patterns: [{include: 'source.lua'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.lua', + patterns: [{include: 'source.lua'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1174,11 +1492,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.lua', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.lua.mdx', - patterns: [{include: 'source.lua'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.lua', + patterns: [{include: 'source.lua'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1195,11 +1519,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.makefile', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.makefile.mdx', - patterns: [{include: 'source.makefile'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.makefile', + patterns: [{include: 'source.makefile'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1212,11 +1542,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.makefile', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.makefile.mdx', - patterns: [{include: 'source.makefile'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.makefile', + patterns: [{include: 'source.makefile'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1233,11 +1569,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.md', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.md.mdx', - patterns: [{include: 'source.gfm'}, {include: 'source.gfm'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.md', + patterns: [{include: 'source.gfm'}, {include: 'source.gfm'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1250,11 +1592,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.md', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.md.mdx', - patterns: [{include: 'source.gfm'}, {include: 'source.gfm'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.md', + patterns: [{include: 'source.gfm'}, {include: 'source.gfm'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1271,11 +1619,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.mdx', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.mdx.mdx', - patterns: [{include: 'source.mdx'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.mdx', + patterns: [{include: 'source.mdx'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1288,11 +1642,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.mdx', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.mdx.mdx', - patterns: [{include: 'source.mdx'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.mdx', + patterns: [{include: 'source.mdx'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1309,11 +1669,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.objc', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.objc.mdx', - patterns: [{include: 'source.objc'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.objc', + patterns: [{include: 'source.objc'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1326,11 +1692,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.objc', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.objc.mdx', - patterns: [{include: 'source.objc'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.objc', + patterns: [{include: 'source.objc'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1347,11 +1719,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.perl', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.perl.mdx', - patterns: [{include: 'source.perl'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.perl', + patterns: [{include: 'source.perl'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1364,11 +1742,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.perl', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.perl.mdx', - patterns: [{include: 'source.perl'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.perl', + patterns: [{include: 'source.perl'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1385,11 +1769,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.php', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.php.mdx', - patterns: [{include: 'text.html.php'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.php', + patterns: [{include: 'text.html.php'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1402,11 +1792,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.php', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.php.mdx', - patterns: [{include: 'text.html.php'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.php', + patterns: [{include: 'text.html.php'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1423,11 +1819,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.python', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.python.mdx', - patterns: [{include: 'source.python'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.python', + patterns: [{include: 'source.python'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1440,11 +1842,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.python', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.python.mdx', - patterns: [{include: 'source.python'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.python', + patterns: [{include: 'source.python'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1461,11 +1869,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.r', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.r.mdx', - patterns: [{include: 'source.r'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.r', + patterns: [{include: 'source.r'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1478,11 +1892,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.r', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.r.mdx', - patterns: [{include: 'source.r'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.r', + patterns: [{include: 'source.r'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1499,11 +1919,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.raku', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.raku.mdx', - patterns: [{include: 'source.raku'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.raku', + patterns: [{include: 'source.raku'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1516,11 +1942,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.raku', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.raku.mdx', - patterns: [{include: 'source.raku'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.raku', + patterns: [{include: 'source.raku'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1537,11 +1969,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.ruby', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.ruby.mdx', - patterns: [{include: 'source.ruby'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.ruby', + patterns: [{include: 'source.ruby'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1554,11 +1992,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.ruby', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.ruby.mdx', - patterns: [{include: 'source.ruby'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.ruby', + patterns: [{include: 'source.ruby'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1575,11 +2019,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.rust', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.rust.mdx', - patterns: [{include: 'source.rust'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.rust', + patterns: [{include: 'source.rust'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1592,11 +2042,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.rust', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.rust.mdx', - patterns: [{include: 'source.rust'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.rust', + patterns: [{include: 'source.rust'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1613,11 +2069,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.scala', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.scala.mdx', - patterns: [{include: 'source.scala'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.scala', + patterns: [{include: 'source.scala'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1630,11 +2092,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.scala', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.scala.mdx', - patterns: [{include: 'source.scala'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.scala', + patterns: [{include: 'source.scala'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1651,11 +2119,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.scss', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.scss.mdx', - patterns: [{include: 'source.css.scss'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.scss', + patterns: [{include: 'source.css.scss'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1668,11 +2142,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.scss', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.scss.mdx', - patterns: [{include: 'source.css.scss'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.scss', + patterns: [{include: 'source.css.scss'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1680,7 +2160,7 @@ const grammar = { patterns: [ { begin: - '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:abuild|alpine\\x2dabuild|apkbuild|gentoo\\x2debuild|gentoo\\x2declass|openrc|openrc\\x2drunscript|shell|shell\\x2dscript|(?:.*\\.)?(?:bash|bats|command|csh|ebuild|eclass|ksh|sh|sh\\.in|tcsh|tmux|tool|zsh|zsh\\x2dtheme)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(`{3,})(?:[\\t ]*((?i:abuild|alpine\\x2dabuild|apkbuild|envrc|gentoo\\x2debuild|gentoo\\x2declass|openrc|openrc\\x2drunscript|shell|shell\\x2dscript|(?:.*\\.)?(?:bash|bats|command|csh|ebuild|eclass|ksh|sh|sh\\.in|tcsh|tmux|tool|zsh|zsh\\x2dtheme)))(?:[\\t ]+((?:[^\\n\\r`])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -1689,15 +2169,21 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.shell', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.shell.mdx', - patterns: [{include: 'source.shell'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.shell', + patterns: [{include: 'source.shell'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: - '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:abuild|alpine\\x2dabuild|apkbuild|gentoo\\x2debuild|gentoo\\x2declass|openrc|openrc\\x2drunscript|shell|shell\\x2dscript|(?:.*\\.)?(?:bash|bats|command|csh|ebuild|eclass|ksh|sh|sh\\.in|tcsh|tmux|tool|zsh|zsh\\x2dtheme)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', + '(?:^|\\G)[\\t ]*(~{3,})(?:[\\t ]*((?i:abuild|alpine\\x2dabuild|apkbuild|envrc|gentoo\\x2debuild|gentoo\\x2declass|openrc|openrc\\x2drunscript|shell|shell\\x2dscript|(?:.*\\.)?(?:bash|bats|command|csh|ebuild|eclass|ksh|sh|sh\\.in|tcsh|tmux|tool|zsh|zsh\\x2dtheme)))(?:[\\t ]+((?:[^\\n\\r])+))?)(?:[\\t ]*$)', beginCaptures: { 1: {name: 'string.other.begin.code.fenced.mdx'}, 2: { @@ -1706,11 +2192,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.shell', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.shell.mdx', - patterns: [{include: 'source.shell'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.shell', + patterns: [{include: 'source.shell'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1727,11 +2219,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.shell-session', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.shell-session.mdx', - patterns: [{include: 'text.shell-session'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.shell-session', + patterns: [{include: 'text.shell-session'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1744,11 +2242,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.shell-session', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.shell-session.mdx', - patterns: [{include: 'text.shell-session'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.shell-session', + patterns: [{include: 'text.shell-session'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1765,11 +2269,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.sql', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.sql.mdx', - patterns: [{include: 'source.sql'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.sql', + patterns: [{include: 'source.sql'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1782,11 +2292,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.sql', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.sql.mdx', - patterns: [{include: 'source.sql'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.sql', + patterns: [{include: 'source.sql'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1803,11 +2319,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.svg', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.svg.mdx', - patterns: [{include: 'text.xml.svg'}, {include: 'text.xml'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.svg', + patterns: [{include: 'text.xml.svg'}, {include: 'text.xml'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1820,11 +2342,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.svg', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.svg.mdx', - patterns: [{include: 'text.xml.svg'}, {include: 'text.xml'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.svg', + patterns: [{include: 'text.xml.svg'}, {include: 'text.xml'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1841,11 +2369,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.swift', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.swift.mdx', - patterns: [{include: 'source.swift'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.swift', + patterns: [{include: 'source.swift'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1858,11 +2392,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.swift', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.swift.mdx', - patterns: [{include: 'source.swift'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.swift', + patterns: [{include: 'source.swift'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1879,11 +2419,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.toml', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.toml.mdx', - patterns: [{include: 'source.toml'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.toml', + patterns: [{include: 'source.toml'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1896,11 +2442,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.toml', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.toml.mdx', - patterns: [{include: 'source.toml'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.toml', + patterns: [{include: 'source.toml'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1917,11 +2469,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.ts', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.ts.mdx', - patterns: [{include: 'source.ts'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.ts', + patterns: [{include: 'source.ts'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1934,11 +2492,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.ts', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.ts.mdx', - patterns: [{include: 'source.ts'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.ts', + patterns: [{include: 'source.ts'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -1955,11 +2519,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.tsx', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.tsx.mdx', - patterns: [{include: 'source.tsx'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.tsx', + patterns: [{include: 'source.tsx'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -1972,11 +2542,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.tsx', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.tsx.mdx', - patterns: [{include: 'source.tsx'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.tsx', + patterns: [{include: 'source.tsx'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -2029,11 +2605,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.vbnet', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.vbnet.mdx', - patterns: [{include: 'source.vbnet'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.vbnet', + patterns: [{include: 'source.vbnet'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -2046,11 +2628,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.vbnet', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.vbnet.mdx', - patterns: [{include: 'source.vbnet'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.vbnet', + patterns: [{include: 'source.vbnet'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -2067,11 +2655,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.xml', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.xml.mdx', - patterns: [{include: 'text.xml'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.xml', + patterns: [{include: 'text.xml'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -2084,11 +2678,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.xml', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.xml.mdx', - patterns: [{include: 'text.xml'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.xml', + patterns: [{include: 'text.xml'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, @@ -2105,11 +2705,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.yaml', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.yaml.mdx', - patterns: [{include: 'source.yaml'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.yaml', + patterns: [{include: 'source.yaml'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] }, { begin: @@ -2122,11 +2728,17 @@ const grammar = { }, 3: {patterns: [{include: '#markdown-string'}]} }, - contentName: 'meta.embedded.yaml', end: '(\\1)(?:[\\t ]*$)', endCaptures: {1: {name: 'string.other.end.code.fenced.mdx'}}, name: 'markup.code.yaml.mdx', - patterns: [{include: 'source.yaml'}] + patterns: [ + { + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.yaml', + patterns: [{include: 'source.yaml'}], + while: '(^|\\G)(?![\\t ]*([`~]{3,})[\\t ]*$)' + } + ] } ] }, diff --git a/lang/source.mo.js b/lang/source.mo.js index aa6e62b..e08b02a 100644 --- a/lang/source.mo.js +++ b/lang/source.mo.js @@ -321,7 +321,7 @@ const grammar = { }, { match: - '\\b(assert|break|case|continue|debug|debug_show|else|if|ignore|in|for|label|null|return|switch|while|loop|try|throw|catch|do|to_candid|from_candid|with)\\b', + '\\b(assert|break|case|continue|debug|debug_show|else|if|ignore|in|for|label|null|return|switch|while|loop|try|throw|catch|finally|do|to_candid|from_candid|with)\\b', name: 'keyword.statement.motoko' }, { diff --git a/lang/source.move.js b/lang/source.move.js index ec959fb..5402394 100644 --- a/lang/source.move.js +++ b/lang/source.move.js @@ -16,12 +16,27 @@ const grammar = { {include: '#comments'}, {include: '#module'}, {include: '#script'}, - {include: '#attributes'}, + {include: '#annotation'}, { begin: '\\b(while)\\b', name: 'keyword.control.while.whaaat.move', while: '[a-z]' - } + }, + {include: '#comments'}, + {include: '#annotation'}, + {include: '#entry'}, + {include: '#public-scope'}, + {include: '#public'}, + {include: '#native'}, + {include: '#import'}, + {include: '#friend'}, + {include: '#const'}, + {include: '#struct'}, + {include: '#has_ability'}, + {include: '#enum'}, + {include: '#macro'}, + {include: '#fun'}, + {include: '#spec'} ], repository: { abilities: { @@ -48,12 +63,22 @@ const grammar = { {include: '#module'} ] }, + annotation: { + begin: '#\\[', + end: '\\]', + name: 'support.constant.annotation.move', + patterns: [ + {match: '\\b(\\w+)\\s*(?=\\=)', name: 'meta.annotation.name.move'}, + { + begin: '=', + end: '(?=[,\\]])', + name: 'meta.annotation.value.move', + patterns: [{include: '#literals'}] + } + ] + }, as: {match: '\\b(as)\\b', name: 'keyword.control.as.move'}, 'as-import': {match: '\\b(as)\\b', name: 'meta.import.as.move'}, - attributes: { - match: '#\\[(?:[\\w0-9=,_\\(\\)\\s"\\:=]+)\\]', - name: 'support.constant.attribute.move' - }, block: { begin: '{', end: '}', @@ -181,6 +206,7 @@ const grammar = { {include: '#local_call'}, {include: '#method_call'}, {include: '#path_access'}, + {include: '#match_expression'}, {match: '\\$(?=[a-z])', name: 'keyword.operator.macro.dollar.move'}, {match: '(?<=[$])[a-z][A-Z_0-9a-z]*', name: 'variable.other.meta.move'}, {match: '\\b([A-Z][A-Z_]+)\\b', name: 'constant.other.move'}, @@ -386,6 +412,27 @@ const grammar = { match: '(\\b|\\.)([a-z][A-Za-z0-9_]*)!', name: 'meta.macro.call' }, + match_expression: { + begin: '\\b(match)\\b', + beginCaptures: {1: {name: 'keyword.control.match.move'}}, + end: '(?<=})', + name: 'meta.match.move', + patterns: [ + {include: '#comments'}, + {include: '#escaped_identifier'}, + {include: '#types'}, + { + begin: '{', + end: '}', + name: 'meta.match.block.move', + patterns: [ + {match: '\\b(=>)\\b', name: 'operator.match.move'}, + {include: '#expr'} + ] + }, + {include: '#expr'} + ] + }, method_call: { captures: {1: {name: 'entity.name.function.call.path.move'}}, match: '\\.([a-z][_a-z0-9]*)(?=[<\\(])', @@ -394,17 +441,32 @@ const grammar = { module: { begin: '\\b(module|spec)\\b', beginCaptures: {1: {name: 'storage.modifier.type.move'}}, - end: '(?<=})', + end: '(?<=[;}])', name: 'meta.module.move', patterns: [ {include: '#comments'}, { - end: '(?={)', + end: '(?=[;{])', patterns: [ {include: '#comments'}, {include: '#escaped_identifier'}, - {end: '(?=[(::){])', name: 'constant.other.move'}, - {begin: '(?<=::)', end: '(?=[\\s{])', name: 'entity.name.type.move'} + { + end: '(?=[(::){])', + name: 'constant.other.move', + patterns: [ + {include: '#comments'}, + {include: '#escaped_identifier'} + ] + }, + { + begin: '(?<=::)', + end: '(?=[\\s;{])', + name: 'entity.name.type.move', + patterns: [ + {include: '#comments'}, + {include: '#escaped_identifier'} + ] + } ] }, { @@ -413,7 +475,7 @@ const grammar = { name: 'meta.module_scope.move', patterns: [ {include: '#comments'}, - {include: '#attributes'}, + {include: '#annotation'}, {include: '#entry'}, {include: '#public-scope'}, {include: '#public'}, @@ -439,6 +501,17 @@ const grammar = { match: '\\b(\\w+)::(\\w+)\\b', name: 'meta.module_access.move' }, + module_label: { + begin: '^\\s*(module)\\b', + end: ';\\s*$', + name: 'meta.module.label.move', + patterns: [ + {include: '#comments'}, + {include: '#escaped_identifier'}, + {end: '(?=[(::){])', name: 'constant.other.move'}, + {begin: '(?<=::)', end: '(?=[\\s{])', name: 'entity.name.type.move'} + ] + }, move_copy: {match: '\\b(move|copy)\\b', name: 'variable.language.move'}, mut: {match: '\\b(mut)\\b', name: 'storage.modifier.mut.move'}, native: { diff --git a/lang/source.nanorc.js b/lang/source.nanorc.js index 187db47..1f8c0a0 100644 --- a/lang/source.nanorc.js +++ b/lang/source.nanorc.js @@ -9,92 +9,191 @@ /** @type {Grammar} */ const grammar = { - dependencies: ['injections.etc'], + dependencies: ['etc', 'injections.etc'], extensions: ['.nanorc'], + injections: { + 'meta.preprocessor.include.nanorc string.quoted.double, meta.option.backupdir.nanorc': + { + patterns: [ + {match: '(?<=")~(?=/)', name: 'keyword.operator.tilde.nanorc'}, + {include: 'etc#globSimple'} + ] + } + }, names: ['nanorc'], patterns: [{include: 'injections.etc#scopeHack'}, {include: '#main'}], repository: { - colours: { + colourParam: { patterns: [ { - begin: '^\\s*(i?color)(?=\\s|$)', - beginCaptures: {1: {name: 'storage.type.var.colour.name.nanorc'}}, - end: '$', - name: 'meta.colour.nanorc', - patterns: [ - { - captures: { - 1: {name: 'punctuation.separator.delimiter.meta.comma.nanorc'}, - 2: {name: 'entity.background.colour.name.nanorc'} - }, - match: '\\G\\s*(,)(\\S+)' - }, - { - captures: { - 1: {name: 'entity.foreground.colour.name.nanorc'}, - 2: {name: 'punctuation.separator.delimiter.meta.comma.nanorc'}, - 3: {name: 'entity.background.colour.name.nanorc'} - }, - match: '\\G\\s*((?!,)\\S+)(,)(\\S+)' - }, - { - captures: { - 1: {name: 'entity.foreground.colour.name.nanorc'}, - 2: {name: 'punctuation.separator.delimiter.meta.comma.nanorc'} - }, - match: '\\G\\s*([^\\s,]+)(,?)(?=\\s|$)' - }, - { - captures: { - 1: {name: 'variable.parameter.attribute.nanorc'}, - 2: { - name: 'punctuation.definition.assignment.equals-sign.nanorc' - } - }, - match: '(?<=\\s|\\G)(start|end)(=)(?=\\s|$)', - name: 'meta.$1-pattern.nanorc' - }, - { - begin: '(?<=\\s|\\G)(start|end)(=)(?=")', - captures: { - 1: {name: 'variable.parameter.attribute.nanorc'}, - 2: { - name: 'punctuation.definition.assignment.equals-sign.nanorc' - } - }, - end: '(?<=")', - name: 'meta.$1-pattern.nanorc', - patterns: [{include: '#regexp'}] - }, - {include: '#regexp'} - ] + match: + '(?x)\n(?:(?<=,|\\s)|^|\\G)\n(\n\t# Basic colour swatches for 8-colour terminals\n\t(?:bright|light)?\n\t(?:black|blue|cyan|green|magenta|red|white|yellow)\n\t|\n\t# Synonym for “lightblack”\n\tgr[ae]y\n\t|\n\t# 256-colour values\n\t(?:beet|brick|brown|crimson|lagoon|latte|lime|mauve|mint|normal|ocher\n\t|orange|peach|pink|plum|purple|rosy|sage|sand|sea|sky|slate|tawny|teal)\n)\n(?=$|,|\\s)', + name: 'constant.language.colour.named.$1.nanorc' + }, + { + captures: { + 1: {name: 'punctuation.definition.constant.colour.nanorc'} + }, + match: '(?:(?<=,|\\s)|^|\\G)(#)[A-Fa-f0-9]{3}(?=$|,|\\s)', + name: 'constant.language.colour.hex.nanorc' + }, + { + captures: { + 1: {name: 'constant.language.colour.placeholder.nanorc'}, + 2: {name: 'invalid.illegal.colour.unsupported.nanorc'} + }, + match: '(?:(?<=,|\\s)|^|\\G)([bf]gcolou?r)|([^\\s,]+)(?=$|,|\\s)' } ] }, + colourParams: { + captures: { + 1: {patterns: [{include: 'etc#bracket'}]}, + 10: {patterns: [{include: 'etc#comma'}]}, + 11: { + name: 'meta.background-colour.nanorc', + patterns: [{include: '#colourParam'}] + }, + 2: {name: 'constant.language.style.bold.nanorc'}, + 3: {patterns: [{include: 'etc#comma'}]}, + 4: {patterns: [{include: 'etc#bracket'}]}, + 5: {patterns: [{include: 'etc#bracket'}]}, + 6: {name: 'constant.language.style.italic.nanorc'}, + 7: {patterns: [{include: 'etc#comma'}]}, + 8: {patterns: [{include: 'etc#bracket'}]}, + 9: { + name: 'meta.foreground-colour.nanorc', + patterns: [{include: '#colourParam'}] + } + }, + match: + '(?x) \\G\n(?:\n\t\\s+\n\t(?: (\\[)? (bold) (,) (\\])?)?\n\t(?: (\\[)? (italic) (,) (\\])?)?\n\t(?<=,\\]|,)\n)?+ \\s*\n(?:\n\t(?=$|\\s)\n\t|\n\t(?= (?!bold|italic) [^\\s,]\n\t| , (?!bold|italic) [^\\s,]\n\t) ([^\\s,]*) (,)? ([^\\s,]*) (?!,)\n)' + }, comment: { begin: '#', beginCaptures: {0: {name: 'punctuation.definition.comment.nanorc'}}, end: '$', name: 'comment.line.number-sign.nanorc' }, + key: {patterns: [{include: '#keyBind'}, {include: '#keyUnbind'}]}, + keyBind: { + patterns: [ + { + captures: { + 1: {name: 'keyword.operator.key.bind.nanorc'}, + 2: {patterns: [{include: '#keyName'}]}, + 3: {name: 'string.quoted.double.nanorc'}, + 4: {name: 'punctuation.definition.string.begin.nanorc'}, + 5: { + patterns: [ + { + begin: '({)', + beginCaptures: { + 0: {name: 'punctuation.section.bracket.curly.begin.nanorc'}, + 1: {name: 'brackethighlighter.curly'} + }, + contentName: 'entity.name.function.nanorc', + end: '(})', + endCaptures: { + 0: {name: 'punctuation.section.bracket.curly.end.nanorc'}, + 1: {name: 'brackethighlighter.curly'} + }, + name: 'meta.command-name.nanorc' + }, + {include: '#keyName'} + ] + }, + 6: {name: 'punctuation.definition.string.end.nanorc'}, + 7: {name: 'constant.other.menu-name.nanorc'} + }, + match: + '^\\s*(bind)\\s+(\\S+)\\s+((")(.*)("))(?:\\s+([^\\s"]+))?(?=\\s*$|\\s+#)', + name: 'meta.bind.nanorc' + }, + { + captures: { + 1: {name: 'keyword.operator.key.bind.nanorc'}, + 2: {patterns: [{include: '#keyName'}]}, + 3: {name: 'entity.name.function.nanorc'}, + 4: {name: 'constant.other.menu-name.nanorc'} + }, + match: + '^\\s*(bind)\\s+(\\S+)\\s+([^"\\s]+)(?:\\s+([^\\s"]+))?(?=\\s*$|\\s+#)', + name: 'meta.bind.nanorc' + } + ] + }, + keyName: { + begin: '(?:^|\\G)(Sh(-))?(M(-))?((\\^))?', + beginCaptures: { + 0: {name: 'meta.key.modifiers.nanorc'}, + 1: {name: 'entity.name.tag.key.modifier.shift.nanorc'}, + 2: {name: 'punctuation.definition.modifier.dash.nanorc'}, + 3: {name: 'entity.name.tag.key.modifier.meta.nanorc'}, + 4: {name: 'punctuation.definition.modifier.dash.nanorc'}, + 5: {name: 'entity.name.tag.key.modifier.ctrl.nanorc'}, + 6: {name: 'punctuation.definition.modifier.caret.nanorc'} + }, + end: '\\S+|(?=$|\\s)', + endCaptures: { + 0: { + patterns: [ + {match: '^Bsp$', name: 'entity.name.tag.key.backspace.nanorc'}, + {match: '^Del$', name: 'entity.name.tag.key.delete.nanorc'}, + {match: '^Down$', name: 'entity.name.tag.key.down.nanorc'}, + {match: '^End$', name: 'entity.name.tag.key.end.nanorc'}, + {match: '^Enter$', name: 'entity.name.tag.key.enter.nanorc'}, + {match: '^Home$', name: 'entity.name.tag.key.home.nanorc'}, + {match: '^Ins$', name: 'entity.name.tag.key.insert.nanorc'}, + {match: '^Left$', name: 'entity.name.tag.key.left.nanorc'}, + {match: '^PgDn$', name: 'entity.name.tag.key.page-down.nanorc'}, + {match: '^PgUp$', name: 'entity.name.tag.key.page-up.nanorc'}, + {match: '^Right$', name: 'entity.name.tag.key.right.nanorc'}, + {match: '^Space$', name: 'entity.name.tag.key.space.nanorc'}, + {match: '^Tab$', name: 'entity.name.tag.key.tab.nanorc'}, + {match: '^Up$', name: 'entity.name.tag.key.up.nanorc'}, + { + captures: { + 1: {name: 'entity.name.tag.key.function.$2.nanorc'}, + 3: {name: 'entity.name.tag.key.verbatim.nanorc'} + }, + match: '^(?:(F(1[0-9]|2[0-4]|[1-9]))|(\\S))$' + } + ] + } + } + }, + keyUnbind: { + captures: { + 1: {name: 'keyword.operator.key.unbind.nanorc'}, + 2: {patterns: [{include: '#keyName'}]}, + 3: {name: 'constant.other.menu-name.nanorc'} + }, + match: '^\\s*(unbind)\\s+(\\S+)(?:\\s+([^\\s"]+))?(?=\\s*$|\\s+#)' + }, main: { patterns: [ {include: '#comment'}, - {include: '#colours'}, + {include: '#key'}, + {include: '#option'}, {include: '#syntax'}, - {include: '#options'} + {include: '#syntaxCommands'}, + {include: '#other'} ] }, - options: { + option: { + begin: '^\\s*(set|unset)(?=\\s+([a-z][a-z_0-9]*))', + beginCaptures: {1: {name: 'keyword.operator.$1.nanorc'}}, + end: '$', + name: 'meta.option.$2.nanorc', + patterns: [{include: '#optionInnards'}] + }, + optionInnards: { patterns: [ { - begin: '^\\s*(set)\\s+(fill|tabsize)(?=\\s|$)', - beginCaptures: { - 1: {name: 'keyword.operator.$1.nanorc'}, - 2: {name: 'entity.option.name.nanorc'} - }, + begin: '\\G\\s*(fill|guidestripe|tabsize)(?=\\s|$)', + beginCaptures: {1: {name: 'entity.option.name.nanorc'}}, end: '$', - name: 'meta.option.$2.nanorc', patterns: [ { match: '[0-9]+', @@ -104,52 +203,54 @@ const grammar = { }, { begin: - '(?x) ^ \\s*\n(set|unset) \\s+\n(autoindent|backup|backwards|boldtext|casesensitive|const|cut\n|historylog|morespace|mouse|multibuffer|noconvert|nofollow|nohelp\n|nonewlines|nowrap|preserve|quickblank|rebinddelete|rebindkeypad\n|regexp|smarthome|smooth|suspend|tabstospaces|tempfile|view\n|wordbounds) (?=\\s|$)', - beginCaptures: { - 1: {name: 'keyword.operator.$1.nanorc'}, - 2: {name: 'entity.option.name.nanorc'} - }, - end: '$', - name: 'meta.option.$2.nanorc' + '(?x) \\G \\s*\n(afterends|allow_insecure_backup|atblanks|autoindent|backup|boldtext|bookstyle|breaklonglines\n|casesensitive|colonparsing|constantshow|cutfromcursor|emptyline|historylog|indicator|jumpyscrolling\n|linenumbers|locking|magic|minibar|mouse|multibuffer|noconvert|nohelp|nonewlines|nowrap|positionlog\n|preserve|quickblank|rawsequences|rebinddelete|regexp|saveonexit|showcursor|smarthome|softwrap\n|stateflags|tabstospaces|trimblanks|unix|wordbounds|zap|zero)\n(?=\\s|$)', + beginCaptures: {1: {name: 'entity.option.name.nanorc'}}, + end: '$' }, { begin: - '(?x) ^ \\s*\n(set) \\s+\n(backupdir|brackets|matchbrackets|operatingdir\n|punct|speller|whitespace) (?=\\s|$)', - beginCaptures: { - 1: {name: 'keyword.operator.$1.nanorc'}, - 2: {name: 'entity.option.name.nanorc'} - }, + '(?x) \\G \\s*\n((error|function|key|mini|number|prompt|scroller|selected|spotlight|status|stripe|title)color)\n(?=\\s|$)', + beginCaptures: {1: {name: 'entity.option.name.nanorc'}}, end: '$', - name: 'meta.option.$2.nanorc', - patterns: [{include: '#string'}] + patterns: [{include: '#colourParams'}] }, { - begin: '^\\s*(include)(?=\\s|$)\\s*', - beginCaptures: { - 1: {name: 'keyword.control.directive.include.nanorc'} - }, - contentName: 'storage.modifier.import.file-name.nanorc', + begin: '\\G\\s*(speller)(?=\\s|$)[ \\t]*', + beginCaptures: {1: {name: 'entity.option.name.nanorc'}}, end: '$', - name: 'meta.preprocessor.include.nanorc' + patterns: [ + { + captures: { + 0: {name: 'string.quoted.double.nanorc'}, + 1: {name: 'punctuation.definition.string.begin.nanorc'}, + 2: { + name: 'source.embedded.shell', + patterns: [{include: 'source.shell'}] + }, + 3: {name: 'punctuation.definition.string.end.nanorc'} + }, + match: '\\G(")(.+)(?:(")(?=[^"]*$)|(?=$))' + } + ] }, { - begin: '^\\s*(set)\\s+(quotestr)(?=\\s|$)', - beginCaptures: { - 1: {name: 'keyword.operator.$1.nanorc'}, - 2: {name: 'entity.option.name.nanorc'} - }, + begin: + '(?x) \\G \\s*\n(backupdir|brackets|matchbrackets|operatingdir|punct|whitespace|wordchars)\n(?=\\s|$)', + beginCaptures: {1: {name: 'entity.option.name.nanorc'}}, + end: '$', + patterns: [{include: '#string'}] + }, + { + begin: '\\G\\s*(quotestr)(?=\\s|$)', + beginCaptures: {1: {name: 'entity.option.name.nanorc'}}, end: '$', - name: 'meta.option.$2.nanorc', patterns: [{include: '#regexp'}] }, { - begin: '^\\s*(?:(set|unset)\\s+)?(\\S+)', - beginCaptures: { - 1: {name: 'keyword.operator.$1.nanorc'}, - 2: {name: 'entity.option.name.nanorc'} - }, + begin: '\\G\\s*(\\S+)', + beginCaptures: {1: {name: 'entity.option.name.nanorc'}}, end: '$', - name: 'meta.option.custom.nanorc', + name: 'meta.custom-option.nanorc', patterns: [ { match: '\\b(true|false|on|off|yes|no)\\b', @@ -164,6 +265,30 @@ const grammar = { } ] }, + other: { + patterns: [ + { + begin: '^\\s*(include)(?=\\s|$)[ \\t]*', + beginCaptures: { + 1: {name: 'keyword.control.directive.include.nanorc'} + }, + contentName: 'meta.import.file-name.nanorc', + end: '$', + name: 'meta.preprocessor.include.nanorc', + patterns: [{include: '#string'}] + }, + { + begin: '^\\s*(extendsyntax)\\s+(\\S+)[ \\t]*', + beginCaptures: { + 1: {name: 'keyword.control.directive.extendsyntax.nanorc'}, + 2: {name: 'variable.parameter.syntax-name.nanorc'} + }, + end: '$', + name: 'meta.override.nanorc', + patterns: [{include: '#syntaxCommands'}, {include: '#optionInnards'}] + } + ] + }, quotedString: { begin: '"', beginCaptures: {0: {name: 'punctuation.definition.string.begin.nanorc'}}, @@ -208,6 +333,103 @@ const grammar = { } ] }, + syntaxCommands: { + patterns: [ + { + applyEndPatternLast: true, + begin: '(?:^|\\G)\\s*(header|magic)(?=$|\\s)[ \\t]*', + beginCaptures: {1: {name: 'keyword.operator.command.$1.nanorc'}}, + end: '(?!\\G)', + name: 'meta.$1-pattern.nanorc', + patterns: [{include: '#regexp'}] + }, + { + begin: '(?:^|\\G)\\s*(comment)(?=$|\\s)[ \\t]*', + beginCaptures: {1: {name: 'keyword.operator.command.$1.nanorc'}}, + end: '$', + name: 'meta.comment-string.nanorc', + patterns: [ + { + captures: { + 1: {name: 'punctuation.definition.string.begin.nanorc'}, + 2: {name: 'punctuation.definition.string.end.nanorc'} + }, + match: '\\G(")(")(?=\\s*$|\\s+#)', + name: 'string.quoted.double.comments.disable.nanorc' + }, + { + captures: { + 1: {name: 'punctuation.definition.string.begin.nanorc'}, + 2: {name: 'constant.other.bracket.begin.nanorc'}, + 3: {name: 'meta.separator.brackets.nanorc'}, + 4: {name: 'constant.other.bracket.end.nanorc'}, + 5: {name: 'punctuation.definition.string.end.nanorc'} + }, + match: '\\G(")([^\\|]+)(\\|)([^\\|]+)(")(?=\\s*$|\\s+#)', + name: 'string.quoted.double.comments.bracket-style.comment' + }, + { + captures: { + 1: {name: 'punctuation.definition.string.begin.nanorc'}, + 2: {name: 'punctuation.definition.string.end.nanorc'} + }, + match: '(").+(")(?=\\s*$|\\s+#)', + name: 'string.quoted.double.comments.verbatim.nanorc' + } + ] + }, + { + begin: '(?:^|\\G)\\s*(tabgives)(?=$|\\s)', + beginCaptures: {1: {name: 'keyword.operator.command.$1.nanorc'}}, + end: '$', + name: 'meta.tabgives.nanorc', + patterns: [{include: '#string'}] + }, + { + captures: { + 1: {name: 'keyword.operator.command.$1.nanorc'}, + 2: { + name: 'source.embedded.shell', + patterns: [{include: 'source.shell'}] + } + }, + match: '(?:^|\\G)\\s*(formatter|linter)(?=$|\\s)(.*)$', + name: 'meta.$1.nanorc' + }, + { + begin: '(?:^|\\G)\\s*(i?color)(?=\\s|$)', + beginCaptures: {1: {name: 'storage.type.var.colour.name.nanorc'}}, + end: '$', + name: 'meta.colour.nanorc', + patterns: [ + {include: '#colourParams'}, + { + captures: { + 1: {name: 'variable.parameter.attribute.nanorc'}, + 2: { + name: 'punctuation.definition.assignment.equals-sign.nanorc' + } + }, + match: '(?<=\\s|\\G)(start|end)(=)(?=\\s|$)', + name: 'meta.$1-pattern.nanorc' + }, + { + begin: '(?<=\\s|\\G)(start|end)(=)(?=")', + captures: { + 1: {name: 'variable.parameter.attribute.nanorc'}, + 2: { + name: 'punctuation.definition.assignment.equals-sign.nanorc' + } + }, + end: '(?<=")', + name: 'meta.$1-pattern.nanorc', + patterns: [{include: '#regexp'}] + }, + {include: '#regexp'} + ] + } + ] + }, unquotedString: {match: '\\S+', name: 'string.unquoted.bareword.nanorc'} }, scopeName: 'source.nanorc' diff --git a/lang/source.nr.js b/lang/source.nr.js new file mode 100644 index 0000000..21c1fb7 --- /dev/null +++ b/lang/source.nr.js @@ -0,0 +1,199 @@ +// This is a TextMate grammar distributed by `starry-night`. +// This grammar is developed at +// +// and licensed `apache-2.0`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + extensions: ['.nr'], + names: ['noir', 'nargo'], + patterns: [{include: '#code'}], + repository: { + '--struct-content': { + patterns: [ + { + begin: '[a-zA-Z_][a-zA-Z0-9_]*', + beginCaptures: {0: {name: 'support.type.property-name.nr'}}, + end: '([a-zA-Z_][a-zA-Z0-9_]*)|,', + endCaptures: {1: {name: 'support.type.nr'}}, + patterns: [{include: '#comments'}] + }, + {begin: '<', end: '>', patterns: [{include: '#--struct-types'}]}, + {include: '#comments'} + ] + }, + '--struct-types': { + patterns: [ + {match: '[a-zA-Z_][a-zA-Z0-9_]*', name: 'support.type.nr'}, + {begin: '<', end: '>', patterns: [{include: '#--struct-types'}]}, + {include: '#comments'} + ] + }, + attribute: { + begin: '#\\[', + end: '\\]', + patterns: [ + {begin: '[a-zA-Z_][a-zA-Z0-9_]\\s*\\(', end: '\\)'}, + {match: '[a-zA-Z_][a-zA-Z0-9_]'} + ] + }, + code: { + patterns: [ + {include: '#comments'}, + {include: '#strings'}, + {include: '#numeric'}, + {include: '#syntax'}, + {include: '#attribute'}, + {include: '#keywords'}, + {include: '#input'} + ] + }, + comments: { + patterns: [ + { + begin: '\\/\\*', + end: '\\*\\/', + name: 'comment.block.nr', + patterns: [{include: '#comments'}] + }, + {match: '\\/\\/.*\n', name: 'comment.line.double-slash.nr'} + ] + }, + input: { + patterns: [ + { + match: '\\b((u|i)\\d+|str|bool|field|Field)\\b', + name: 'support.type.nr' + }, + { + match: '\\b(_*[A-Z][a-zA-Z0-9_]*|[a-zA-Z_][a-zA-Z0-9_]*::)\\b', + name: 'support.type.nr' + }, + { + begin: '\\b([a-z_][a-zA-Z0-9_]*)\\s*\\(', + beginCaptures: {1: {name: 'support.function.nr'}}, + end: '\\)', + patterns: [{include: '#code'}] + }, + {match: '\\b[a-z_][a-zA-Z0-9_]*\\b', name: 'variable.nr'} + ] + }, + keywords: { + patterns: [ + { + match: '\\b(fn|impl|trait|type|mod|use|struct|if|else|for)\\b', + name: 'keyword.control.nr' + }, + { + match: + '\\b(global|comptime|quote|unsafe|unconstrained|pub|&mut|mut|self|in|as|let)\\b', + name: 'keyword.nr' + } + ] + }, + numeric: { + patterns: [ + { + match: '(\\-)?\\d+\\.\\d+(\\.|[a-zA-Z])', + name: 'token.error-token.nr' + }, + {match: '(\\-)?0x[0-9a-fA-F]+', name: 'constant.numeric.nr'}, + {match: '(\\-)?\\d+(\\.\\d+)?', name: 'constant.numeric.nr'}, + {match: '\\b(true|false)\\b', name: 'constant.language.nr'} + ] + }, + strings: { + captures: { + 1: {patterns: [{match: '\\\\.', name: 'constant.character.escape.nr'}]} + }, + match: '"(.*?)(\n|(?)\\s*([a-zA-Z_][a-zA-Z0-9_]*)' + } + ] + } + }, + scopeName: 'source.nr' +} + +export default grammar diff --git a/lang/source.p4.js b/lang/source.p4.js index 330b5ff..58ed4de 100644 --- a/lang/source.p4.js +++ b/lang/source.p4.js @@ -34,26 +34,21 @@ const grammar = { }, { match: - '\\b(struct|package|header|metadata|parser|transition|state|actions|action|table|key|control|extern|verify)\\b', + '\\b(header_type|header|metadata|field_list|field_list_calculation|parser|parser_exception|parser_value_set|counter|meter|register|action|action_profile|table|control|extern)\\b', name: 'storage.type.object.p4' }, - { - match: '\\b(void|const|bool|varbit|int|typedef|tuple|enum)\\b', - name: 'storage.data.type.p4' - }, - {match: 'bit(<\\d+>)', name: 'support.type.bit.p4'}, + {match: '\\b(bool|bit|varbit|int)\\b', name: 'storage.data.type.p4'}, { match: '\\b(hit|miss|latest|return|default)\\b', name: 'variable.language.p4' }, { - match: - '\\b(if|else if|else|return|hit|miss|true|false|inout|in|out|exit)\\b', + match: '\\b(if|else if|else|return|hit|miss|true|false)\\b', name: 'keyword.control.p4' }, {match: '\\b(and|or)\\b', name: 'keyword.operator.p4'}, { - match: '\\b(exact|ternary|lpm|range|valid|mask|match_kind)\\b', + match: '\\b(exact|ternary|lpm|range|valid|mask)\\b', name: 'entity.name.type.p4' }, { @@ -69,21 +64,15 @@ const grammar = { }, {match: '\\b(length|fields|max_length)\\b', name: 'entity.name.type.p4'}, {match: '\\#include', name: 'meta.preprocessor.include.p4'}, - { - match: '\\#ifndef|\\#ifdef|\\#if|\\#else|\\#endif|\\#elif', - name: 'meta.preprocessor.p4' - }, {match: '\\#define', name: 'meta.preprocessor.define.p4'}, { match: '\\b(apply|valid|select|current|extract|add_header|copy_header|remove_header|modify_field|add_to_field|add|set_field_to_hash_index|truncate|drop|no_op|push|pop|count|meter|generate_digest|resubmit|recirculate|clone_ingress_pkt_to_ingress|clone_egress_pkt_to_ingress|clone_ingress_pkt_to_egress|clone_egress_pkt_to_egress|register_write|register_read)\\b', name: 'support.function.primitive.p4' }, - {match: '@\\w+', name: 'storage.type.annotation.p4'}, {match: '[a-zA-Z_][0-9a-zA-Z_]*', name: 'support.any-method.p4'}, {match: "[\\+|-]?[0-9]+'[0-9]+", name: 'constant.numeric.p4'}, {match: '0(x|X)[0-9a-fA-F]+', name: 'constant.numeric.p4'}, - {match: '\\dw\\d+', name: 'constant.numeric.p4'}, {match: '0(b|B)[01]+', name: 'constant.numeric.p4'}, {match: '[0-9]+', name: 'constant.numeric.p4'}, {match: '\\b(true|false)\\b', name: 'constant.language.p4'} diff --git a/lang/source.peggy.js b/lang/source.peggy.js new file mode 100644 index 0000000..b99f43a --- /dev/null +++ b/lang/source.peggy.js @@ -0,0 +1,94 @@ +// This is a TextMate grammar distributed by `starry-night`. +// This grammar is developed at +// +// and licensed `mit`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + dependencies: ['source.js'], + extensions: ['.pegjs', '.peggy'], + names: ['peg.js'], + patterns: [ + {include: '#comment'}, + {include: '#label'}, + {include: '#defRule'}, + {include: '#rule'}, + {include: '#literal'}, + {include: '#charclass'}, + {include: '#operators'}, + {include: '#inlinejs'} + ], + repository: { + charclass: { + begin: '\\[', + end: '\\]', + name: 'declaration.keyword.peggy', + patterns: [{match: '\\\\.', name: 'constant.character.escape.peggy'}] + }, + comment: { + patterns: [ + {begin: '/\\*', end: '\\*/', name: 'comment.block.peggy'}, + {match: '//.*$\\n?', name: 'comment.line.double-slash.peggy'} + ] + }, + defRule: { + captures: {1: {name: 'entity.name.function.peggy'}}, + match: '(\\w+)\\s*(?=\\=)' + }, + inlinejs: { + begin: '{', + end: '}', + name: 'meta.embedded.block.javascript', + patterns: [{include: 'source.js'}] + }, + label: { + captures: {1: {name: 'entity.other.attribute-name.attribute.peggy'}}, + match: '(\\w+)\\s*(?=:)' + }, + literal: { + patterns: [ + { + begin: '"', + end: '"', + name: 'string.quoted.double.peggy', + patterns: [ + { + match: + '\\\\(x[[:xdigit:]]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)', + name: 'constant.character.escape.peggy' + }, + { + match: '[^"]*[^\\n\\r"\\\\]$', + name: 'invalid.illegal.string.peggy' + } + ] + }, + { + begin: "'", + end: "'", + name: 'string.quoted.single.peggy', + patterns: [ + { + match: + '\\\\(x[[:xdigit:]]{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)', + name: 'constant.character.escape.peggy' + }, + { + match: "[^']*[^\\n\\r'\\\\]$", + name: 'invalid.illegal.string.peggy' + } + ] + } + ] + }, + operators: {match: '[*?/.!=+&@]', name: 'keyword.operator.peggy'}, + rule: {match: '[a-zA-Z_][a-zA-Z_0-9$]*', name: 'entity.name.function.peggy'} + }, + scopeName: 'source.peggy' +} + +export default grammar diff --git a/lang/source.pegjs.js b/lang/source.pegjs.js index 7fa6ae6..aa33d8e 100644 --- a/lang/source.pegjs.js +++ b/lang/source.pegjs.js @@ -1,177 +1,2 @@ -// This is a TextMate grammar distributed by `starry-night`. -// This grammar is developed at -// -// and licensed `isc`. -// See for more info. -/** - * @import {Grammar} from '@wooorm/starry-night' - */ - -/** @type {Grammar} */ -const grammar = { - dependencies: ['source.js'], - extensions: ['.pegjs'], - names: ['peg.js'], - patterns: [ - { - begin: '\\A\\s*(?=$|/[/*])', - end: '(?=[^/\\s]|/[^/*])', - patterns: [{include: '#comments'}] - }, - { - begin: '(?=\\S)', - end: '(?=A)B', - patterns: [ - { - begin: '\\G(?={)', - end: '(?<=})', - name: 'meta.prologue.initialiser.pegjs', - patterns: [{include: '#block'}] - }, - {include: '#main'} - ] - } - ], - repository: { - block: { - begin: '{', - beginCaptures: { - 0: {name: 'punctuation.section.block.bracket.curly.begin.pegjs'} - }, - contentName: 'source.embedded.js', - end: '}', - endCaptures: { - 0: {name: 'punctuation.section.block.bracket.curly.end.pegjs'} - }, - name: 'meta.block.pegjs', - patterns: [{include: 'source.js'}] - }, - charSet: { - begin: '(?=\\[)', - end: '(?<=\\])(i)?', - endCaptures: {1: {name: 'storage.modifier.ignore-case.pegjs'}}, - patterns: [{include: 'source.js.regexp'}] - }, - comments: { - patterns: [ - { - begin: '//', - beginCaptures: {0: {name: 'punctuation.definition.comment.pegjs'}}, - end: '$', - name: 'comment.line.double-slash.pegjs' - }, - { - begin: '/\\*', - beginCaptures: { - 0: {name: 'punctuation.definition.comment.begin.pegjs'} - }, - end: '\\*/', - endCaptures: {0: {name: 'punctuation.definition.comment.end.pegjs'}}, - name: 'comment.block.pegjs' - } - ] - }, - exprInnards: { - patterns: [ - {include: '#strings'}, - {include: '#label'}, - {include: '#ruleRef'}, - {include: '#charSet'}, - {include: '#comments'}, - {include: '#group'}, - {include: '#block'}, - {match: '/', name: 'keyword.operator.logical.or.pegjs'}, - {match: '\\.', name: 'constant.character.wildcard.dot.match.any.pegjs'}, - {match: '@', name: 'keyword.operator.pluck.pegjs'}, - {match: '[&!]', name: 'keyword.operator.logical.predicate.pegjs'}, - {match: '[?*+]', name: 'keyword.operator.quantifier.pegjs'} - ] - }, - group: { - begin: '\\(', - beginCaptures: {0: {name: 'punctuation.definition.group.begin.pegjs'}}, - end: '\\)', - endCaptures: {0: {name: 'punctuation.definition.group.end.pegjs'}}, - name: 'meta.group.pegjs', - patterns: [{include: '#exprInnards'}] - }, - label: { - captures: { - 1: {name: 'variable.label.pegjs'}, - 2: {name: 'punctuation.definition.label.pegjs'} - }, - match: '(?!\\d)([$\\w]+)\\s*(:)' - }, - main: {patterns: [{include: '#comments'}, {include: '#rule'}]}, - rule: { - begin: '(?!\\d)(?=[$\\w])', - end: '(?!\\G)', - patterns: [ - { - applyEndPatternLast: true, - begin: '\\G([$\\w]+)', - beginCaptures: {1: {name: 'entity.name.rule.pegjs'}}, - end: '\\s*(;)|(?=^\\s*(?:[^@$\\w\\s\\\\]|[$\\w]+(?!\\s*:)))', - endCaptures: { - 1: {name: 'punctuation.delimiter.separator.semicolon.pegjs'} - }, - name: 'meta.rule.$1.definition.pegjs', - patterns: [ - { - begin: '(?="|\')', - end: '(?!\\G)', - name: 'meta.rule.human-readable-name.pegjs', - patterns: [{include: '#strings'}] - }, - { - begin: '\\s*(=)\\s*', - beginCaptures: {1: {name: 'keyword.operator.assignment.pegjs'}}, - end: '(?=;|^(?=\\s*(?![$\\w]+\\s*:|/[^*/])[^\\s/"\'{]))', - name: 'meta.expression.pegjs', - patterns: [{include: '#exprInnards'}] - }, - {include: '#comments'} - ] - }, - {include: '#comments'} - ] - }, - ruleRef: { - match: '(?!\\d)[$\\w]+', - name: 'entity.name.rule.reference.pegjs' - }, - strings: { - patterns: [ - { - begin: '"', - beginCaptures: { - 0: {name: 'punctuation.definition.string.begin.pegjs'} - }, - end: '(?[a-zA-Z_][a-zA-Z0-9_]*(?:::[a-zA-Z0-9_]+)*){0}((?:(resource|actor)\\s+(\\g)(?:\\s+(extends)\\s+(\\g(?:\\s*,\\s*\\g)*)\\s*,?\\s*)?)|(global))\\s*{', beginCaptures: { - 2: {name: 'keyword.control'}, - 3: {name: 'entity.name.type'}, - 4: {name: 'keyword.control'} + 3: {name: 'keyword.control'}, + 4: {name: 'entity.name.type'}, + 5: {name: 'keyword.control'}, + 6: { + patterns: [ + { + match: '([a-zA-Z_][a-zA-Z0-9_]*(?:::[a-zA-Z0-9_]+)*)', + name: 'entity.name.type' + } + ] + }, + 7: {name: 'keyword.control'} }, end: '\\}', name: 'meta.resource-block', diff --git a/lang/source.powerbuilder.js b/lang/source.powerbuilder.js new file mode 100644 index 0000000..aaef4db --- /dev/null +++ b/lang/source.powerbuilder.js @@ -0,0 +1,305 @@ +// This is a TextMate grammar distributed by `starry-night`. +// This grammar is developed at +// +// and licensed `mit`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + extensions: ['.pbt', '.sra', '.sru', '.srw'], + names: ['powerbuilder'], + patterns: [ + {include: '#strings'}, + {include: '#general_rules'}, + {include: '#comments'}, + {include: '#keywords'}, + {include: '#sql_keywords'}, + {include: '#literals'}, + {include: '#special_rules'}, + {include: '#final'} + ], + repository: { + comments: { + patterns: [ + {match: '//.*$', name: 'comment.line.double-slash.powerbuilder'}, + { + begin: '/\\*', + end: '\\*/', + name: 'comment.block.documentation.powerbuilder' + }, + { + begin: '\\A(HA)?', + captures: { + 1: {name: 'comment.block.documentation.headers.powerbuilder'} + }, + end: '^(?!\\$)', + name: 'meta.header.powerbuilder', + patterns: [ + { + captures: { + 1: {name: 'comment.block.documentation.headers.powerbuilder'}, + 2: {name: 'variable.other.header.name.powerbuilder'}, + 3: {name: 'comment.block.documentation.headers.powerbuilder'}, + 4: { + name: 'string.unquoted.header.description.powerbuilder', + patterns: [{include: '#string-escapes'}] + } + }, + match: '(\\$)(.*?)(\\$)(.*)', + name: 'meta.header.line.powerbuilder' + } + ] + } + ] + }, + final: { + patterns: [ + {match: '[\\w\\d$#%\\-]+', name: 'variable.other.local.powerbuilder'}, + { + match: '(\\+|\\-|\\*|\\/|\\^|=|>|<|&)', + name: 'keyword.operator.symbols.powerbuilder' + } + ] + }, + general_rules: { + patterns: [ + { + begin: + '(?i)^\\s*(close|commit|connect|declare|delete|describe|disconnect|execute|fetch|insert|open|prepare|rollback|select|selectblob|update|updateblob)\\b(?!\\s*\\()', + captures: {1: {name: 'keyword.operator.sql.powerbuilder'}}, + end: ';', + name: 'meta.sql.statement.powerbuilder', + patterns: [ + {include: '#sql_keywords'}, + {include: '#literals'}, + { + match: '(?<=::|\\.)[\\w\\d$#%\\-]+', + name: 'variable.other.local.powerbuilder' + }, + { + match: ':?([\\w\\d$#%\\-]+)', + name: 'variable.other.local.powerbuilder' + } + ] + }, + { + captures: { + 1: {name: 'keyword.other.types.powerbuilder'}, + 2: {name: 'entity.type.name.complex.powerbuilder'} + }, + match: '(?i)\\b(create)\\s+([\\w\\d$#%\\-`]+)', + name: 'meta.variable.create.powerbuilder' + }, + { + captures: { + 1: {name: 'keyword.other.types.powerbuilder'}, + 2: {name: 'variable.other.local.powerbuilder'} + }, + match: '(?i)\\b(create\\s+using)(\\s+[\\w\\d$#%\\-]+)?', + name: 'meta.variable.create_using.powerbuilder' + }, + { + captures: { + 1: {name: 'keyword.other.types.powerbuilder'}, + 2: {name: 'entity.type.name.complex.powerbuilder'}, + 3: {name: 'keyword.other.types.powerbuilder'}, + 4: {name: 'entity.other.inherited-class.powerbuilder'}, + 6: {name: 'keyword.other.types.powerbuilder'}, + 7: {name: 'entity.other.inherited-class.powerbuilder'} + }, + match: + '(?i)\\b(type)\\s+([\\w\\d$#%\\-]+)\\s+(from)\\s+([\\w\\d$#%\\-`]+)(\\s+(within)\\s+([\\w\\d$#%\\-`]+))?', + name: 'meta.type.declaration.powerbuilder' + }, + { + captures: { + 1: {name: 'keyword.other.functions.powerbuilder'}, + 2: {patterns: [{include: '#types'}]} + }, + match: + '(?i)\\b(throws)\\s+([\\w\\d$#%\\-`]+(,\\s*[\\w\\d$#%\\-`]+)*)', + name: 'meta.function.throws_clause.powerbuilder' + }, + { + captures: { + 1: {name: 'keyword.other.functions.powerbuilder'}, + 3: {name: 'keyword.other.types.powerbuilder'}, + 4: {patterns: [{include: '#types'}]}, + 5: {name: 'entity.name.function.event.powerbuilder'}, + 7: {name: 'entity.name.tag.event.powerbuilder'} + }, + match: + '(?i)(event)(\\s+(type)\\s+([\\w\\d$#%\\-`]+))?\\s+([\\w\\d$#%\\-]+)\\s*(\\s([\\w\\d$#%\\-]+)\\s*($|;)|(?=\\())', + name: 'meta.event.declaration_definition.powerbuilder' + } + ] + }, + keywords: { + patterns: [ + { + match: '(?i)\\b(or|and|not)\\b', + name: 'keyword.operator.boolean.powerbuilder' + }, + { + match: '(?i)\\b(constant|readonly|ref)\\b', + name: 'keyword.other.variable.modifier.powerbuilder' + }, + { + match: + '(?i)\\b(public|private|protected|privatewrite|privateread|protectedread|protectedwrite|systemread|systemwrite)\\b', + name: 'keyword.other.access.powerbuilder' + }, + { + match: '(?i)\\b(super|this|sqlca|parent)\\b', + name: 'variable.language.powerbuiler' + }, + { + match: + '(?i)\\b(indirect|variables|end\\s+variables|forward|end\\s+forward|destroy|create|type|end\\s+type|prototypes|within|autoinstantiate|system)\\b', + name: 'keyword.other.types.powerbuilder' + }, + { + match: '(?i)\\b(global|shared)\\b', + name: 'keyword.other.scope.powerbuilder' + }, + { + match: + '(?i)\\b(return|function|end\\s+function|subroutine|end\\s+subroutine|throw|throws|event|end\\s+event|on|end\\s+on|call|dynamic|post|trigger|open|static|alias\\s+for|alias|library|rpcfunc)\\b', + name: 'keyword.other.functions.powerbuilder' + }, + { + match: + '(?i)\\b(if|then|else|elseif|case|choose|exit|continue|for|to|step|next|do|while|loop|until|try|catch|finally|release|end|goto|halt)\\b', + name: 'keyword.control.powerbuilder' + }, + { + match: + '(?i)\\b(namespace|intrinsic|with|_debug|enumerated|external|native)\\b', + name: 'keyword.other.reserved.powerbuilder' + } + ] + }, + literals: { + patterns: [ + { + match: '\\b\\d{4}-\\d{2}-\\d{2}\\b', + name: 'constant.numeric.date.powerbuilder' + }, + { + match: '\\b\\d{2}:\\d{2}:\\d{2}(.\\d+)?\\b', + name: 'constant.numeric.time.powerbuilder' + }, + { + match: '\\b(\\d+(\\.\\d+)?|(\\.\\d+))([eE][+\\-]\\d+)?\\b', + name: 'constant.numeric.number.powerbuilder' + }, + { + match: '(?i)\\b(true|false)\\b', + name: 'constant.language.boolean.powerbuilder' + }, + { + match: '[\\w\\d$#%\\-]+!', + name: 'constant.language.enumerated.powerbuilder' + } + ] + }, + primitives: { + patterns: [ + { + match: + '(?i)\\b(any|blob|boolean|byte|char|character|date|datetime|dec|decimal|double|int|integer|long|longlong|longptr|real|string|time|uint|ulong|unsignedinteger|unsignedlong)\\b', + name: 'entity.name.type.primitives.powerbuilder' + } + ] + }, + special_rules: { + patterns: [ + { + match: '[\\w\\d$#%\\-]+(?=\\s*\\()', + name: 'entity.name.function.powerbuilder' + }, + { + match: '(?<=::|\\.)[\\w\\d$#%\\-]+', + name: 'variable.other.member.powerbuilder' + }, + { + captures: { + 1: {patterns: [{include: '#types'}]}, + 2: {name: 'entity.name.function.powerbuilder'} + }, + match: '([\\w\\d$#%\\-]+)\\s+([\\w\\d$#%\\-]+)(?=\\s*\\()', + name: 'meta.function.declaration.powerbuilder' + }, + { + captures: { + 1: {patterns: [{include: '#types'}]}, + 3: {name: 'constant.numeric.number.powerbuilder'}, + 4: {name: 'variable.other.local.powerbuilder'} + }, + match: + '(?i)([\\w\\d$#%\\-`]+)\\s*(\\{(\\d+)\\}|\\s)\\s*(?!or|and|then)([\\w\\d$#%\\-]+)', + name: 'meta.variable.declaration.powerbuilder' + } + ] + }, + sql_keywords: { + patterns: [ + { + match: '(?i)\\b(or|and|xor|not)\\b', + name: 'keyword.operator.sql.boolean.powerbuilder' + }, + { + match: + '(?i)\\b(close|commit|connect|declare|delete|describe|disconnect|execute|fetch|insert|open|prepare|rollback|select|selectblob|update|updateblob)\\b', + name: 'keyword.operator.sql.powerbuilder' + }, + { + match: + '(?i)\\b(set|current|of|is|using|null|from|into|values|where|first|prior|last|rollback|immediate|descriptor|cursor|procedure|for|of)\\b', + name: 'keyword.operator.sql.powerbuilder' + } + ] + }, + 'string-escapes': { + patterns: [ + {match: '~o?\\d{3}', name: 'constant.character.escape.powerbuilder'}, + { + match: '~h[0-9a-fA-F]{2}', + name: 'constant.character.escape.powerbuilder' + }, + {match: '~.', name: 'constant.character.escape.powerbuilder'} + ] + }, + strings: { + patterns: [ + { + begin: '\\"', + end: '\\"', + name: 'string.quoted.double.powerbuilder', + patterns: [{include: '#string-escapes'}] + }, + { + begin: "\\'", + end: "\\'", + name: 'string.quoted.single.powerbuilder', + patterns: [{include: '#string-escapes'}] + } + ] + }, + types: { + patterns: [ + {include: '#primitives'}, + { + match: '([\\w\\d$#%\\-`]+)', + name: 'entity.name.type.complex.powerbuilder' + } + ] + } + }, + scopeName: 'source.powerbuilder' +} + +export default grammar diff --git a/lang/source.qsharp.js b/lang/source.qsharp.js index 9d192b2..1dd7963 100644 --- a/lang/source.qsharp.js +++ b/lang/source.qsharp.js @@ -1,6 +1,6 @@ // This is a TextMate grammar distributed by `starry-night`. // This grammar is developed at -// +// // and licensed `mit`. // See for more info. /** @@ -14,8 +14,7 @@ const grammar = { patterns: [ {include: '#comments'}, {include: '#keywords'}, - {include: '#library'}, - {include: '#operations'}, + {include: '#operators'}, {include: '#types'}, {include: '#constants'}, {include: '#strings'} @@ -30,60 +29,32 @@ const grammar = { constants: { patterns: [ { - match: '\\b(true|false|Pauli(I|X|Y|Z)|One|Zero)\\b', + match: '\\b(true|false|Pauli(I|X|Y|Z))\\b', name: 'constant.language.qsharp' - } + }, + {match: '\\b(One|Zero)\\b', name: 'constant.other.result.qsharp'} ] }, keywords: { patterns: [ { match: - '\\b(use|using|borrow|borrowing|mutable|let|set|if|elif|else|repeat|until|fixup|for|in|while|return|fail|within|apply)\\b', + '\\b(use|borrow|mutable|let|set|if|elif|else|repeat|until|fixup|for|in|while|return|fail|within|apply)\\b', name: 'keyword.control.qsharp' }, - {match: '\\b(new|not|and|or|w/)\\b', name: 'keyword.other.qsharp'}, - { - match: - '\\b(abstract|base|bool|break|byte|case|catch|char|checked|class|const|continue|decimal|default|delegate|do|double)\\b', - name: 'invalid.illegal.ad.qsharp' - }, - { - match: - '\\b(enum|event|explicit|extern|finally|fixed|float|foreach|goto|implicit|int|interface|lock|long)\\b', - name: 'invalid.illegal.el.qsharp' - }, - { - match: - '\\b(null|object|operator|out|override|params|private|protected|public|readonly|ref|sbyte|sealed|short|sizeof|stackalloc)\\b', - name: 'invalid.illegal.ns.qsharp' - }, { match: - '\\b(static|string|struct|switch|this|throw|try|typeof|unit|ulong|unchecked|unsafe|ushort|virtual|void|volatile)\\b', - name: 'invalid.illegal.sv.qsharp' - } - ] - }, - library: { - patterns: [ - { - match: - '\\b(I|X|Y|Z|H|HY|S|T|SWAP|CNOT|CCNOT|MultiX|R|RFrac|Rx|Ry|Rz|R1|R1Frac|Exp|ExpFrac|Measure|M|MultiM)\\b', - name: 'support.function.quantum.qsharp' - }, - { - match: '\\b(Message|Length|Floor)\\b', - name: 'support.function.builtin.qsharp' + '\\b(namespace|open|import|export|as|internal|newtype|struct|operation|function|new|body|(a|A)djoint|(c|C)ontrolled|self|auto|distribute|invert|intrinsic)\\b', + name: 'keyword.other.qsharp' } ] }, - operations: { + operators: { patterns: [ { match: - '\\b(namespace|open|as|internal|newtype|operation|function|body|(a|A)djoint|(c|C)ontrolled|self|auto|distribute|invert|intrinsic)\\b', - name: 'keyword.other.qsharp' + '\\b(not|and|or)\\b|\\b(w/)|(=)|(!)|(<)|(>)|(\\+)|(-)|(\\*)|(\\/)|(\\^)|(%)|(\\|)|(\\&\\&\\&)|(\\~\\~\\~)|(\\.\\.\\.)|(\\.\\.)|(\\?)', + name: 'keyword.other.operator.qsharp' } ] }, diff --git a/lang/source.rpgle.js b/lang/source.rpgle.js index cb5871a..9834838 100644 --- a/lang/source.rpgle.js +++ b/lang/source.rpgle.js @@ -337,7 +337,8 @@ const grammar = { name: 'keyword.other.rpgle' }, { - match: '((?i)[@#a-zA-Z_][@#a-zA-Z0-9_]*)|\\(|\\)|\\%', + match: + '((?i)[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*)|\\(|\\)|\\%', name: 'variable.other' } ] @@ -350,7 +351,7 @@ const grammar = { }, { match: - '(?i)(?<=((?<=^.{5}C).{19}))(Z\\-SUB|Z\\-ADD|XML\\-SAX|XML\\-INTO|XLATE|XFOOT|WRITE|WHEN|UPDATE|UNLOCK|TIME|TESTZ|TESTN|TESTB|TEST|TAG|SUBST|SUBDUR|SUB|SQRT|SORTA|SHTDN|SETON|SETOFF|SETLL|SETGT|SELECT|SCAN|ROLBK|RETURN|RESET|REL|REALLOC|READPE|READP|READE|READC|READ|POST|PLIST|PARM|OUT|OTHER|OR|OPEN|ON\\-EXIT|ON\\-ERROR|OCCUR|NEXT|MVR|MULT|MOVEL|MOVEA|MOVE|MONITOR|MLLZO|MLHZO|MHLZO|MHHZO|LOOKUP|LEAVESR|LEAVE|KLIST|KFLD|ITER|IN|IF|GOTO|FORCE|FOR|FEOD|EXTRCT|EXSR|EXFMT|EXCEPT|EVAL-CORR|EVALR|EVAL|ENDFOR|ENDSR|ENDIF|ENDDO|ENDCS|ENDWH|ENDSL|END|ELSEIF|ELSE|DUMP|DSPLY|DOW|DOU|DO|DIV|DELETE|DEFINE|DEALLOC|DATA-INTO|COMP|COMMIT|CLOSE|CLEAR|CHECKR|CHECK|CHAIN|CAT|CAS|CALLP|CALLB|CALL|CAB|BITON|BITOFF|BEGSR|AND|ALLOC|ADDUR|ADD|ACQ)', + '(?i)(?<=((?<=^.{5}C).{19}))(Z\\-SUB|Z\\-ADD|XML\\-SAX|XML\\-INTO|XLATE|XFOOT|WRITE|WHEN|UPDATE|UNLOCK|TIME|TESTZ|TESTN|TESTB|TEST|TAG|SUBST|SUBDUR|SUB|SQRT|SORTA|SHTDN|SETON|SETOFF|SETLL|SETGT|SELECT|SCAN|ROLBK|RETURN|RESET|REL|REALLOC|READPE|READP|READE|READC|READ|POST|PLIST|PARM|OUT|OTHER|OR|OPEN|ON\\-EXIT|ON\\-ERROR|OCCUR|NEXT|MVR|MULT|MOVEL|MOVEA|MOVE|MONITOR|MLLZO|MLHZO|MHLZO|MHHZO|LOOKUP|LEAVESR|LEAVE|KLIST|KFLD|ITER|IN|IF|GOTO|FORCE|FOR|FEOD|EXTRCT|EXSR|EXFMT|EXCEPT|EVAL-CORR|EVALR|EVAL|ENDFOR|ENDSR|ENDIF|ENDDO|ENDCS|ENDWH|ENDSL|END|ELSEIF|ELSE|DUMP|DSPLY|DOW|DOU|DO|DIV|DELETE|DEFINE|DEALLOC|DATA-INTO|DATA-GEN|COMP|COMMIT|CLOSE|CLEAR|CHECKR|CHECK|CHAIN|CAT|CAS|CALLP|CALLB|CALL|CAB|BITON|BITOFF|BEGSR|AND|ALLOC|ADDUR|ADD|ACQ)', name: 'keyword.other.rpgle.fixed.c.operation' }, { @@ -522,6 +523,23 @@ const grammar = { {match: '(//).*', name: 'comment.line.rpgle.free'} ] }, + { + begin: '(?i)(?=(\\b(DCL\\-)(PR|DS)\\b))', + end: '\n', + name: 'rpgle.free.definition.complex-single', + patterns: [ + { + match: '(?i)\\b(DCL\\-)(PR|DS)\\b', + name: 'storage.type.rpgle.free.definition.complex-single.dcl' + }, + { + match: '(?i)\\b(END\\-)(PR|DS)\\b', + name: 'storage.type.rpgle.free.definition.complex-single.end' + }, + {include: '#freedefkeywords'}, + {include: '#rpglecommon'} + ] + }, { begin: '(?i)(?=(\\b(DCL\\-)(DS|ENUM|PROC|PR|PI)\\b))', end: '\n', @@ -546,7 +564,7 @@ const grammar = { }, { match: - '(?i)\\b(Z\\-SUB|Z\\-ADD|XML\\-SAX|XML\\-INTO|XLATE|XFOOT|WRITE|WHEN-IN|WHEN-IS|WHEN|UPDATE|UNLOCK|TIME|TESTZ|TESTN|TESTB|TEST|TAG|SUBST|SUBDUR|SUB|SQRT|SQLSTATE|SQLCODE|SORTA|SND\\-MSG|SHTDN|SETON|SETOFF|SETLL|SETGT|SELECT|SCAN|ROLBK|RETURN|RESET|REL|REALLOC|READPE|READP|READE|READC|READ|POST|PLIST|PARM|OUT|OTHER|OR|OPEN|ON\\-EXIT|ON\\-EXCP|ON\\-ERROR|OCCUR|NEXT|MVR|MULT|MOVEL|MOVEA|MOVE|MONITOR|MLLZO|MLHZO|MHLZO|MHHZO|LOOKUP|LEAVESR|LEAVE|KLIST|KFLD|ITER|IN|IF|GOTO|FORCE|FOR\\-EACH|FOR|FEOD|EXTRCT|EXSR|EXFMT|EXCEPT|EVAL-CORR|EVALR|EVAL|ENDSR|ENDMON|ENDFOR|ENDIF|ENDDO|ENDCS|ENDWH|ENDSL|END|ELSEIF|ELSE|DUMP|DSPLY|DOW|DOU|DO|DIV|DELETE|DEFINE|DEALLOC|DATA-INTO|COMP|COMMIT|CLOSE|CLEAR|CHECKR|CHECK|CHAIN|CAT|CAS|CALLP|CALLB|CALL|CAB|BITON|BITOFF|BEGSR|AND|ALLOC|ADDUR|ADD|ACQ)\\b', + '(?i)\\b(Z\\-SUB|Z\\-ADD|XML\\-SAX|XML\\-INTO|XLATE|XFOOT|WRITE|WHEN-IN|WHEN-IS|WHEN|UPDATE|UNLOCK|TIME|TESTZ|TESTN|TESTB|TEST|TAG|SUBST|SUBDUR|SUB|SQRT|SQLSTATE|SQLCODE|SORTA|SND\\-MSG|SHTDN|SETON|SETOFF|SETLL|SETGT|SELECT|SCAN|ROLBK|RETURN|RESET|REL|REALLOC|READPE|READP|READE|READC|READ|POST|PLIST|PARM|OUT|OTHER|OR|OPEN|ON\\-EXIT|ON\\-EXCP|ON\\-ERROR|OCCUR|NEXT|MVR|MULT|MOVEL|MOVEA|MOVE|MONITOR|MLLZO|MLHZO|MHLZO|MHHZO|LOOKUP|LEAVESR|LEAVE|KLIST|KFLD|ITER|IN|IF|GOTO|FORCE|FOR\\-EACH|FOR|FEOD|EXTRCT|EXSR|EXFMT|EXCEPT|EVAL-CORR|EVALR|EVAL|ENDSR|ENDMON|ENDFOR|ENDIF|ENDDO|ENDCS|ENDWH|ENDSL|END|ELSEIF|ELSE|DUMP|DSPLY|DOW|DOU|DO|DIV|DELETE|DEFINE|DEALLOC|DATA-INTO|DATA-GEN|COMP|COMMIT|CLOSE|CLEAR|CHECKR|CHECK|CHAIN|CAT|CAS|CALLP|CALLB|CALL|CAB|BITON|BITOFF|BEGSR|AND|ALLOC|ADDUR|ADD|ACQ)\\b', name: 'keyword.other.rpgle.free' }, {include: '#freeidentifiers'}, @@ -556,7 +574,7 @@ const grammar = { freeidentifiers: { patterns: [ { - begin: '[a-zA-Z_][a-zA-Z0-9_]*', + begin: '[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*', end: '(?=\n)', name: 'variable.other.rpgle.free.definition.identifier', patterns: [{include: '#freedefkeywords'}, {include: '#rpglecommon'}] @@ -575,7 +593,7 @@ const grammar = { }, { match: - '[%](?i)(YEARS|XML|XLATE|XFOOT|UPPER|UNSH|UNS|UCS2|TRIMR|TRIML|TRIM|TLOOKUPLT|TLOOKUPLE|TLOOKUPGT|TLOOKUPGE|TLOOKUP|TIMESTAMP|TIME|THIS|TARGET|SUBST|SUBDT|SUBARR|STR|STATUS|SQRT|SPLIT|SIZE|SHTDN|SECONDS|SCANRPL|SCANR|SCAN|RIGHT|REPLACE|REM|REALLOC|RANGE|PROC|PASSED|PARSER|PARMNUM|PARMS|PADDR|OPEN|OMITTED|OCCUR|NULLIND|MSG|MSECONDS|MONTHS|MINUTES|MINARR|MIN|MAXARR|MAX|LOWER|LOOKUPLT|LOOKUPLE|LOOKUPGT|LOOKUPGE|LOOKUP|LIST|LEN|LEFT|KDS|INTH|INT|HOURS|HANDLER|GRAPH|FOUND|FLOAT|FIELDS|ERROR|EQUAL|EOF|ELEM|EDITW|EDITFLT|EDITC|DIV|DIFF|DECPOS|DECH|DEC|DAYS|DATE|DATA|CONCATARR|CONCAT|CHECKR|CHECK|CHARCOUNT|CHAR|BITXOR|BITOR|BITNOT|BITAND|ALLOC|ADDR|ABS)', + '[%](?i)(YEARS|XML|XLATE|XFOOT|UPPER|UNSH|UNS|UCS2|TRIMR|TRIML|TRIM|TLOOKUPLT|TLOOKUPLE|TLOOKUPGT|TLOOKUPGE|TLOOKUP|TIMESTAMP|TIME|THIS|TARGET|SUBST|SUBDT|SUBARR|STR|STATUS|SQRT|SPLIT|SIZE|SHTDN|SECONDS|SCANRPL|SCANR|SCAN|RIGHT|REPLACE|REM|REALLOC|RANGE|PROC|PASSED|PARSER|PARMNUM|PARMS|PADDR|OPEN|OMITTED|OCCUR|NULLIND|MSG|MSECONDS|MONTHS|MINUTES|MINARR|MIN|MAXARR|MAX|LOWER|LOOKUPLT|LOOKUPLE|LOOKUPGT|LOOKUPGE|LOOKUP|LIST|LEN|LEFT|KDS|INTH|INT|HOURS|HANDLER|GRAPH|GEN|FOUND|FLOAT|FIELDS|ERROR|EQUAL|EOF|ELEM|EDITW|EDITFLT|EDITC|DIV|DIFF|DECPOS|DECH|DEC|DAYS|DATE|DATA|CONCATARR|CONCAT|CHECKR|CHECK|CHARCOUNT|CHAR|BITXOR|BITOR|BITNOT|BITAND|ALLOC|ADDR|ABS)', name: 'support.function.rpgle.bif' } ] @@ -722,15 +740,17 @@ const grammar = { name: 'constant.language.rpgle.sql.globals' }, { - match: '[a-zA-Z_][a-zA-Z0-9_]*(?=\\()', + match: + '[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*(?=\\()', name: 'support.function.rpgle.sql' }, { - match: '[a-zA-Z_][a-zA-Z0-9_]*(\\.|\\/)[a-zA-Z_][a-zA-Z0-9_]*', + match: + '[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*(\\.|\\/)[a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ]*', name: 'constant.language.rpgle.sql.schema' }, { - match: '[:][a-zA-Z_@#][a-zA-Z0-9_@#\\.]*', + match: '[:][a-zA-Z_#@$§ÆØÅÄ֣ѥàÐŞİ][a-zA-Z0-9_#@$§ÆØÅÄ֣ѥàÐŞİ\\.]*', name: 'variable.parameter.rpgle.sql' }, { diff --git a/lang/source.rust.js b/lang/source.rust.js index ad20d68..ffd180d 100644 --- a/lang/source.rust.js +++ b/lang/source.rust.js @@ -245,8 +245,11 @@ const grammar = { 4: {name: 'punctuation.brackets.round.rust'}, 5: {name: 'punctuation.brackets.angle.rust'} }, - end: '\\{|;', - endCaptures: {0: {name: 'punctuation.brackets.curly.rust'}}, + end: '(\\{)|(;)', + endCaptures: { + 1: {name: 'punctuation.brackets.curly.rust'}, + 2: {name: 'punctuation.semi.rust'} + }, name: 'meta.function.definition.rust', patterns: [ {include: '#block-comments'}, @@ -412,7 +415,7 @@ const grammar = { {match: '\\.(?!\\.)', name: 'keyword.operator.access.dot.rust'}, {match: '\\.{2}(=|\\.)?', name: 'keyword.operator.range.rust'}, {match: ':(?!:)', name: 'keyword.operator.key-value.rust'}, - {match: '->', name: 'keyword.operator.arrow.skinny.rust'}, + {match: '->|<-', name: 'keyword.operator.arrow.skinny.rust'}, {match: '=>', name: 'keyword.operator.arrow.fat.rust'}, {match: '\\$', name: 'keyword.operator.macro.dollar.rust'}, {match: '\\?', name: 'keyword.operator.question.rust'} diff --git a/lang/source.sourcepawn.js b/lang/source.sourcepawn.js index 2ca1f5a..a675ef2 100644 --- a/lang/source.sourcepawn.js +++ b/lang/source.sourcepawn.js @@ -633,7 +633,7 @@ const grammar = { 6: {patterns: [{include: '#array-indexed-access'}]} }, match: - '(?:(stock|public)\\s+)?((?:(?:const|static)\\s+)*)(\\w+)(\\s*(?:\\[[^\\]]*\\]\\s*)*)\\s+(\\w+)\\s*(\\s*(?:\\[[^\\]]*\\]\\s*)*)' + '(?:(stock|public)\\s+)?((?:(?:const|static)\\s+)*)(\\w+)(\\s*(?:\\[[^\\]]*\\]\\s*)*)(?:(?:\\s*&\\s*)|\\s+)(\\w+)\\s*(\\s*(?:\\[[^\\]]*\\]\\s*)*)' } ] }, diff --git a/lang/source.stan.js b/lang/source.stan.js index e1e342a..caac9ee 100644 --- a/lang/source.stan.js +++ b/lang/source.stan.js @@ -12,76 +12,21 @@ const grammar = { extensions: ['.stan'], names: ['stan'], patterns: [ - {include: '#comments'}, - {include: '#strings'}, - {include: '#numbers'}, - { - match: - '\\b(functions|data|transformed\\s+data|parameters|transformed\\s+parameters|model|generated\\s+quantities)\\b', - name: 'entity.name.type.stan' - }, { + captures: {1: {name: 'entity.name.type.stan'}}, match: - '\\b(int|real|complex|array|vector|simplex|unit_vector|ordered|positive_ordered|row_vector|matrix|complex_vector|complex_matrix|complex_row_vector|corr_matrix|cov_matrix|cholesky_factor_cov|cholesky_factor_corr|void)\\b', - name: 'storage.type.stan' - }, - { - match: '\\b(for|in|while|if|else|break|continue)\\b', - name: 'keyword.control.stan' - }, - { - captures: { - 1: {name: 'keyword.other.range.stan'}, - 2: {name: 'punctuation.operator.equal.stan'} - }, - match: '\\b(lower|upper|offset|multiplier)\\s*(=)' - }, - {match: '\\breturn\\b', name: 'keyword.other.return.stan'}, - { - captures: { - 1: {name: 'keyword.other.target.stan'}, - 2: {name: 'keyword.operator.accumulator.stan'} - }, - match: '\\b(target)\\s*([+][=])' + '\\b(functions|data|transformed\\s+data|parameters|transformed\\s+parameters|model|generated\\s+quantities)\\b\\s*\\{' }, - {match: '\\bT(?=\\s*\\[)', name: 'keyword.other.truncation.stan'}, + {include: '#comments'}, + {include: '#strings'}, + {include: '#numbers'}, + {include: '#types'}, + {include: '#keywords'}, {include: '#distributions'}, - { - match: '\\b(print|reject)\\b', - name: 'keyword.other.special-functions.stan' - }, - { - match: '\\b(integrate_ode_(?:bdf|rk45))\\b', - name: 'support.function.integrate_ode.stan' - }, - { - match: '\\balgebra_solver\\b', - name: 'support.function.algebra_solver.stan' - }, {include: '#functions'}, - {include: '#reserved'}, - { - match: '\\b([a-zA-Z0-9_]*__|[0-9_][A-Za-z0-9_]+|_)\\b', - name: 'invalid.illegal.variable' - }, - { - match: '\\b[A-Za-z][0-9A-Za-z_]*\\b', - name: 'variable.other.identifier.stan' - }, + {include: '#variables'}, {include: '#operators'}, - {match: ',', name: 'meta.delimiter.comma.stan'}, - { - begin: '{', - beginCaptures: {0: {name: 'punctuation.section.block.begin.stan'}}, - end: '}', - endCaptures: {0: {name: 'punctuation.section.block.end.stan'}}, - patterns: [{include: '$base'}] - }, - {match: '[{}]', name: 'meta.brace.curly.stan'}, - {match: '\\[|\\]', name: 'meta.brace.square.stan'}, - {match: '\\(|\\)', name: 'meta.brace.round.stan'}, - {match: '\\;', name: 'punctuation.terminator.statement.stan'}, - {match: '[|]', name: 'punctuation.sampling.bar.stan'} + {include: '#punctuation'} ], repository: { comments: { @@ -90,46 +35,22 @@ const grammar = { begin: '^\\s*((#)\\s*(include))\\b\\s*', beginCaptures: { 1: {name: 'keyword.control.directive.include.stan'}, - 2: {name: 'punctuation.definition.directive.stan'}, - 4: {name: 'string.quoted.other.include.stan'} + 2: {name: 'punctuation.definition.directive.stan'} }, end: '\\s*(?=(?://|/\\*|#)|\\n|$)', name: 'meta.preprocessor.include.stan', patterns: [ { - begin: '"', + begin: '["<]?', beginCaptures: { 0: {name: 'punctuation.definition.string.begin.stan'} }, - end: '"', + end: '[">]?\\s', endCaptures: { 0: {name: 'punctuation.definition.string.end.stan'} }, name: 'string.quoted.double.include.stan' - }, - { - begin: '<', - beginCaptures: { - 0: {name: 'punctuation.definition.string.begin.stan'} - }, - end: '>', - endCaptures: { - 0: {name: 'punctuation.definition.string.end.stan'} - }, - name: 'string.quoted.other.lt-gt.include.stan' - }, - { - begin: "'", - beginCaptures: { - 0: {name: 'punctuation.definition.string.begin.stan'} - }, - end: "'", - endCaptures: { - 0: {name: 'punctuation.definition.string.end.stan'} - }, - name: 'string.quoted.single.include.stan' - }, - {match: '.+', name: 'string.quoted.other.noquote.include.stan'} + } ] }, { @@ -168,16 +89,7 @@ const grammar = { 3: {name: 'support.function.distribution.stan'} }, match: - '(~)(\\s*)(bernoulli|bernoulli_logit|bernoulli_logit_glm|beta|beta_binomial|binomial|binomial_logit|categorical|categorical_logit|categorical_logit_glm|cauchy|chi_square|dirichlet|discrete_range|double_exponential|exp_mod_normal|exponential|frechet|gamma|gaussian_dlm_obs|gumbel|hypergeometric|inv_chi_square|inv_gamma|inv_wishart|inv_wishart_cholesky|lkj_corr|lkj_corr_cholesky|logistic|loglogistic|lognormal|multi_gp|multi_gp_cholesky|multi_normal|multi_normal_cholesky|multi_normal_prec|multi_student_t|multi_student_t_cholesky|multinomial|multinomial_logit|neg_binomial|neg_binomial_2|neg_binomial_2_log|neg_binomial_2_log_glm|normal|normal_id_glm|ordered_logistic|ordered_logistic_glm|ordered_probit|pareto|pareto_type_2|poisson|poisson_log|poisson_log_glm|rayleigh|scaled_inv_chi_square|skew_double_exponential|skew_normal|std_normal|student_t|uniform|von_mises|weibull|wiener|wishart|wishart_cholesky)\\b', - name: 'meta.sampling.stan' - }, - { - captures: { - 1: {name: 'keyword.operator.sampling.stan'}, - 3: {name: 'variable.other.distribution.stan'} - }, - match: '(~)(\\s*)([A-Za-z][A-Za-z0-9_]*)\\b', - name: 'meta.sampling.stan' + '(~)(\\s*)(bernoulli|bernoulli_logit|bernoulli_logit_glm|beta|beta_binomial|binomial|binomial_logit|binomial_logit_glm|categorical|categorical_logit|categorical_logit_glm|cauchy|chi_square|dirichlet|dirichlet_multinomial|discrete_range|double_exponential|exp_mod_normal|exponential|frechet|gamma|gaussian_dlm_obs|gumbel|hypergeometric|inv_chi_square|inv_gamma|inv_wishart|inv_wishart_cholesky|lkj_corr|lkj_corr_cholesky|logistic|loglogistic|lognormal|multi_gp|multi_gp_cholesky|multi_normal|multi_normal_cholesky|multi_normal_prec|multi_student_t|multi_student_t_cholesky|multinomial|multinomial_logit|neg_binomial|neg_binomial_2|neg_binomial_2_log|neg_binomial_2_log_glm|normal|normal_id_glm|ordered_logistic|ordered_logistic_glm|ordered_probit|pareto|pareto_type_2|poisson|poisson_log|poisson_log_glm|rayleigh|scaled_inv_chi_square|skew_double_exponential|skew_normal|std_normal|student_t|uniform|von_mises|weibull|wiener|wishart|wishart_cholesky)\\b' } ] }, @@ -193,16 +105,41 @@ const grammar = { patterns: [ { match: - '\\b([A-Za-z0-9][A-Za-z0-9_]*_log|binomial_coefficient_log|fabs|get_lp|if_else|increment_log_prob|integrate_ode|lkj_cov|multiply_log)\\b', + '\\b([A-Za-z0-9][A-Za-z0-9_]*_log|binomial_coefficient_log|fabs|get_lp|if_else|increment_log_prob|integrate_ode[A-Za-z0-9_]*|lkj_cov_lpdf|multiply_log)\\b\\s*\\(', name: 'invalid.deprecated.function.stan' }, { match: - '\\b(Phi|Phi_approx|abs|acos|acosh|add_diag|algebra_solver|algebra_solver_newton|append_array|append_col|append_row|arg|asin|asinh|atan|atan2|atanh|bernoulli_cdf|bernoulli_lccdf|bernoulli_lcdf|bernoulli_logit_glm_lpmf|bernoulli_logit_glm_lupmf|bernoulli_logit_glm_rng|bernoulli_logit_lpmf|bernoulli_logit_lupmf|bernoulli_logit_rng|bernoulli_lpmf|bernoulli_lupmf|bernoulli_rng|bessel_first_kind|bessel_second_kind|beta|beta_binomial_cdf|beta_binomial_lccdf|beta_binomial_lcdf|beta_binomial_lpmf|beta_binomial_lupmf|beta_binomial_rng|beta_cdf|beta_lccdf|beta_lcdf|beta_lpdf|beta_lupdf|beta_proportion_lccdf|beta_proportion_lcdf|beta_proportion_rng|beta_rng|binary_log_loss|binomial_cdf|binomial_lccdf|binomial_lcdf|binomial_logit_lpmf|binomial_logit_lupmf|binomial_lpmf|binomial_lupmf|binomial_rng|block|categorical_logit_glm_lpmf|categorical_logit_glm_lupmf|categorical_logit_lpmf|categorical_logit_lupmf|categorical_logit_rng|categorical_lpmf|categorical_lupmf|categorical_rng|cauchy_cdf|cauchy_lccdf|cauchy_lcdf|cauchy_lpdf|cauchy_lupdf|cauchy_rng|cbrt|ceil|chi_square_cdf|chi_square_lccdf|chi_square_lcdf|chi_square_lpdf|chi_square_lupdf|chi_square_rng|chol2inv|cholesky_decompose|choose|col|cols|columns_dot_product|columns_dot_self|complex_schur_decompose|complex_schur_decompose_t|complex_schur_decompose_u|conj|cos|cosh|cov_exp_quad|crossprod|csr_extract|csr_extract_u|csr_extract_v|csr_extract_w|csr_matrix_times_vector|csr_to_dense_matrix|cumulative_sum|dae|dae_tol|determinant|diag_matrix|diag_post_multiply|diag_pre_multiply|diagonal|digamma|dims|dirichlet_lpdf|dirichlet_lupdf|dirichlet_rng|discrete_range_cdf|discrete_range_lccdf|discrete_range_lcdf|discrete_range_lpmf|discrete_range_lupmf|discrete_range_rng|distance|dot_product|dot_self|double_exponential_cdf|double_exponential_lccdf|double_exponential_lcdf|double_exponential_lpdf|double_exponential_lupdf|double_exponential_rng|e|eigendecompose|eigendecompose_sym|eigenvalues|eigenvalues_sym|eigenvectors|eigenvectors_sym|erf|erfc|exp|exp2|exp_mod_normal_cdf|exp_mod_normal_lccdf|exp_mod_normal_lcdf|exp_mod_normal_lpdf|exp_mod_normal_lupdf|exp_mod_normal_rng|expm1|exponential_cdf|exponential_lccdf|exponential_lcdf|exponential_lpdf|exponential_lupdf|exponential_rng|falling_factorial|fdim|fft|fft2|floor|fma|fmax|fmin|fmod|frechet_cdf|frechet_lccdf|frechet_lcdf|frechet_lpdf|frechet_lupdf|frechet_rng|gamma_cdf|gamma_lccdf|gamma_lcdf|gamma_lpdf|gamma_lupdf|gamma_p|gamma_q|gamma_rng|gaussian_dlm_obs_lpdf|gaussian_dlm_obs_lupdf|generalized_inverse|get_imag|get_real|gumbel_cdf|gumbel_lccdf|gumbel_lcdf|gumbel_lpdf|gumbel_lupdf|gumbel_rng|head|hmm_hidden_state_prob|hmm_latent_rng|hmm_marginal|hypergeometric_lpmf|hypergeometric_lupmf|hypergeometric_rng|hypot|identity_matrix|inc_beta|int_step|integrate_1d|integrate_ode|integrate_ode_adams|integrate_ode_bdf|integrate_ode_rk45|inv|inv_Phi|inv_chi_square_cdf|inv_chi_square_lccdf|inv_chi_square_lcdf|inv_chi_square_lpdf|inv_chi_square_lupdf|inv_chi_square_rng|inv_cloglog|inv_erfc|inv_fft|inv_fft2|inv_gamma_cdf|inv_gamma_lccdf|inv_gamma_lcdf|inv_gamma_lpdf|inv_gamma_lupdf|inv_gamma_rng|inv_inc_beta|inv_logit|inv_sqrt|inv_square|inv_wishart_cholesky_lpdf|inv_wishart_cholesky_lupdf|inv_wishart_cholesky_rng|inv_wishart_lpdf|inv_wishart_lupdf|inv_wishart_rng|inverse|inverse_spd|is_inf|is_nan|lambert_w0|lambert_wm1|lbeta|lchoose|ldexp|lgamma|linspaced_array|linspaced_int_array|linspaced_row_vector|linspaced_vector|lkj_corr_cholesky_lpdf|lkj_corr_cholesky_lupdf|lkj_corr_cholesky_rng|lkj_corr_lpdf|lkj_corr_lupdf|lkj_corr_rng|lmgamma|lmultiply|log|log10|log1m|log1m_exp|log1m_inv_logit|log1p|log1p_exp|log2|log_determinant|log_diff_exp|log_falling_factorial|log_inv_logit|log_inv_logit_diff|log_mix|log_modified_bessel_first_kind|log_rising_factorial|log_softmax|log_sum_exp|logistic_cdf|logistic_lccdf|logistic_lcdf|logistic_lpdf|logistic_lupdf|logistic_rng|logit|loglogistic_cdf|loglogistic_lpdf|loglogistic_rng|lognormal_cdf|lognormal_lccdf|lognormal_lcdf|lognormal_lpdf|lognormal_lupdf|lognormal_rng|machine_precision|map_rect|matrix_exp|matrix_exp_multiply|matrix_power|max|mdivide_left_spd|mdivide_left_tri_low|mdivide_right_spd|mdivide_right_tri_low|mean|min|modified_bessel_first_kind|modified_bessel_second_kind|multi_gp_cholesky_lpdf|multi_gp_cholesky_lupdf|multi_gp_lpdf|multi_gp_lupdf|multi_normal_cholesky_lpdf|multi_normal_cholesky_lupdf|multi_normal_cholesky_rng|multi_normal_lpdf|multi_normal_lupdf|multi_normal_prec_lpdf|multi_normal_prec_lupdf|multi_normal_rng|multi_student_cholesky_t_rng|multi_student_t_cholesky_lpdf|multi_student_t_cholesky_lupdf|multi_student_t_cholesky_rng|multi_student_t_lpdf|multi_student_t_lupdf|multi_student_t_rng|multinomial_logit_lpmf|multinomial_logit_lupmf|multinomial_logit_rng|multinomial_lpmf|multinomial_lupmf|multinomial_rng|multiply_lower_tri_self_transpose|neg_binomial_2_cdf|neg_binomial_2_lccdf|neg_binomial_2_lcdf|neg_binomial_2_log_glm_lpmf|neg_binomial_2_log_glm_lupmf|neg_binomial_2_log_lpmf|neg_binomial_2_log_lupmf|neg_binomial_2_log_rng|neg_binomial_2_lpmf|neg_binomial_2_lupmf|neg_binomial_2_rng|neg_binomial_cdf|neg_binomial_lccdf|neg_binomial_lcdf|neg_binomial_lpmf|neg_binomial_lupmf|neg_binomial_rng|negative_infinity|norm|norm1|norm2|normal_cdf|normal_id_glm_lpdf|normal_id_glm_lupdf|normal_lccdf|normal_lcdf|normal_lpdf|normal_lupdf|normal_rng|not_a_number|num_elements|ode_adams|ode_adams_tol|ode_adjoint_tol_ctl|ode_bdf|ode_bdf_tol|ode_ckrk|ode_ckrk_tol|ode_rk45|ode_rk45_tol|one_hot_array|one_hot_int_array|one_hot_row_vector|one_hot_vector|ones_array|ones_int_array|ones_row_vector|ones_vector|ordered_logistic_glm_lpmf|ordered_logistic_glm_lupmf|ordered_logistic_lpmf|ordered_logistic_lupmf|ordered_logistic_rng|ordered_probit_lpmf|ordered_probit_lupmf|ordered_probit_rng|owens_t|pareto_cdf|pareto_lccdf|pareto_lcdf|pareto_lpdf|pareto_lupdf|pareto_rng|pareto_type_2_cdf|pareto_type_2_lccdf|pareto_type_2_lcdf|pareto_type_2_lpdf|pareto_type_2_lupdf|pareto_type_2_rng|pi|poisson_cdf|poisson_lccdf|poisson_lcdf|poisson_log_glm_lpmf|poisson_log_glm_lupmf|poisson_log_lpmf|poisson_log_lupmf|poisson_log_rng|poisson_lpmf|poisson_lupmf|poisson_rng|polar|positive_infinity|pow|prod|proj|qr|qr_Q|qr_R|qr_thin|qr_thin_Q|qr_thin_R|quad_form|quad_form_diag|quad_form_sym|quantile|rank|rayleigh_cdf|rayleigh_lccdf|rayleigh_lcdf|rayleigh_lpdf|rayleigh_lupdf|rayleigh_rng|reduce_sum|rep_array|rep_matrix|rep_row_vector|rep_vector|reverse|rising_factorial|round|row|rows|rows_dot_product|rows_dot_self|scale_matrix_exp_multiply|scaled_inv_chi_square_cdf|scaled_inv_chi_square_lccdf|scaled_inv_chi_square_lcdf|scaled_inv_chi_square_lpdf|scaled_inv_chi_square_lupdf|scaled_inv_chi_square_rng|sd|segment|sin|singular_values|sinh|size|skew_double_exponential_cdf|skew_double_exponential_lccdf|skew_double_exponential_lcdf|skew_double_exponential_lpdf|skew_double_exponential_lupdf|skew_double_exponential_rng|skew_normal_cdf|skew_normal_lccdf|skew_normal_lcdf|skew_normal_lpdf|skew_normal_lupdf|skew_normal_rng|softmax|sort_asc|sort_desc|sort_indices_asc|sort_indices_desc|sqrt|sqrt2|square|squared_distance|std_normal_cdf|std_normal_lccdf|std_normal_lcdf|std_normal_log_qf|std_normal_lpdf|std_normal_lupdf|std_normal_qf|std_normal_rng|step|student_t_cdf|student_t_lccdf|student_t_lcdf|student_t_lpdf|student_t_lupdf|student_t_rng|sub_col|sub_row|sum|svd|svd_U|svd_V|symmetrize_from_lower_tri|tail|tan|tanh|target|tcrossprod|tgamma|to_array_1d|to_array_2d|to_complex|to_int|to_matrix|to_row_vector|to_vector|trace|trace_gen_quad_form|trace_quad_form|trigamma|trunc|uniform_cdf|uniform_lccdf|uniform_lcdf|uniform_lpdf|uniform_lupdf|uniform_rng|uniform_simplex|variance|von_mises_cdf|von_mises_lccdf|von_mises_lcdf|von_mises_lpdf|von_mises_lupdf|von_mises_rng|weibull_cdf|weibull_lccdf|weibull_lcdf|weibull_lpdf|weibull_lupdf|weibull_rng|wiener_lpdf|wiener_lupdf|wishart_cholesky_lpdf|wishart_cholesky_lupdf|wishart_cholesky_rng|wishart_lpdf|wishart_lupdf|wishart_rng|zeros_array|zeros_int_array|zeros_row_vector)\\b', + '\\b(Phi|Phi_approx|abs|acos|acosh|add_diag|algebra_solver|algebra_solver_newton|append_array|append_col|append_row|arg|asin|asinh|atan|atan2|atanh|bernoulli_cdf|bernoulli_lccdf|bernoulli_lcdf|bernoulli_logit_glm_lpmf|bernoulli_logit_glm_lupmf|bernoulli_logit_glm_rng|bernoulli_logit_lpmf|bernoulli_logit_lupmf|bernoulli_logit_rng|bernoulli_lpmf|bernoulli_lupmf|bernoulli_rng|bessel_first_kind|bessel_second_kind|beta|beta_binomial_cdf|beta_binomial_lccdf|beta_binomial_lcdf|beta_binomial_lpmf|beta_binomial_lupmf|beta_binomial_rng|beta_cdf|beta_lccdf|beta_lcdf|beta_lpdf|beta_lupdf|beta_proportion_lccdf|beta_proportion_lcdf|beta_proportion_rng|beta_rng|binary_log_loss|binomial_cdf|binomial_lccdf|binomial_lcdf|binomial_logit_glm_lpmf|binomial_logit_glm_lupmf|binomial_logit_lpmf|binomial_logit_lupmf|binomial_lpmf|binomial_lupmf|binomial_rng|block|categorical_logit_glm_lpmf|categorical_logit_glm_lupmf|categorical_logit_lpmf|categorical_logit_lupmf|categorical_logit_rng|categorical_lpmf|categorical_lupmf|categorical_rng|cauchy_cdf|cauchy_lccdf|cauchy_lcdf|cauchy_lpdf|cauchy_lupdf|cauchy_rng|cbrt|ceil|chi_square_cdf|chi_square_lccdf|chi_square_lcdf|chi_square_lpdf|chi_square_lupdf|chi_square_rng|chol2inv|cholesky_decompose|choose|col|cols|columns_dot_product|columns_dot_self|complex_schur_decompose|complex_schur_decompose_t|complex_schur_decompose_u|conj|cos|cosh|cov_exp_quad|crossprod|csr_extract|csr_extract_u|csr_extract_v|csr_extract_w|csr_matrix_times_vector|csr_to_dense_matrix|cumulative_sum|dae|dae_tol|determinant|diag_matrix|diag_post_multiply|diag_pre_multiply|diagonal|digamma|dims|dirichlet_lpdf|dirichlet_lupdf|dirichlet_multinomial_lpmf|dirichlet_multinomial_lupmf|dirichlet_multinomial_rng|dirichlet_rng|discrete_range_cdf|discrete_range_lccdf|discrete_range_lcdf|discrete_range_lpmf|discrete_range_lupmf|discrete_range_rng|distance|dot_product|dot_self|double_exponential_cdf|double_exponential_lccdf|double_exponential_lcdf|double_exponential_lpdf|double_exponential_lupdf|double_exponential_rng|e|eigendecompose|eigendecompose_sym|eigenvalues|eigenvalues_sym|eigenvectors|eigenvectors_sym|erf|erfc|exp|exp2|exp_mod_normal_cdf|exp_mod_normal_lccdf|exp_mod_normal_lcdf|exp_mod_normal_lpdf|exp_mod_normal_lupdf|exp_mod_normal_rng|expm1|exponential_cdf|exponential_lccdf|exponential_lcdf|exponential_lpdf|exponential_lupdf|exponential_rng|falling_factorial|fatal_error|fdim|fft|fft2|floor|fma|fmax|fmin|fmod|frechet_cdf|frechet_lccdf|frechet_lcdf|frechet_lpdf|frechet_lupdf|frechet_rng|gamma_cdf|gamma_lccdf|gamma_lcdf|gamma_lpdf|gamma_lupdf|gamma_p|gamma_q|gamma_rng|gaussian_dlm_obs_lpdf|gaussian_dlm_obs_lupdf|generalized_inverse|get_imag|get_real|gumbel_cdf|gumbel_lccdf|gumbel_lcdf|gumbel_lpdf|gumbel_lupdf|gumbel_rng|head|hmm_hidden_state_prob|hmm_latent_rng|hmm_marginal|hypergeometric_lpmf|hypergeometric_lupmf|hypergeometric_rng|hypot|identity_matrix|inc_beta|int_step|integrate_1d|integrate_ode|integrate_ode_adams|integrate_ode_bdf|integrate_ode_rk45|inv|inv_Phi|inv_chi_square_cdf|inv_chi_square_lccdf|inv_chi_square_lcdf|inv_chi_square_lpdf|inv_chi_square_lupdf|inv_chi_square_rng|inv_cloglog|inv_erfc|inv_fft|inv_fft2|inv_gamma_cdf|inv_gamma_lccdf|inv_gamma_lcdf|inv_gamma_lpdf|inv_gamma_lupdf|inv_gamma_rng|inv_inc_beta|inv_logit|inv_sqrt|inv_square|inv_wishart_cholesky_lpdf|inv_wishart_cholesky_lupdf|inv_wishart_cholesky_rng|inv_wishart_lpdf|inv_wishart_lupdf|inv_wishart_rng|inverse|inverse_spd|is_inf|is_nan|lambert_w0|lambert_wm1|lbeta|lchoose|ldexp|lgamma|linspaced_array|linspaced_int_array|linspaced_row_vector|linspaced_vector|lkj_corr_cholesky_lpdf|lkj_corr_cholesky_lupdf|lkj_corr_cholesky_rng|lkj_corr_lpdf|lkj_corr_lupdf|lkj_corr_rng|lmgamma|lmultiply|log|log10|log1m|log1m_exp|log1m_inv_logit|log1p|log1p_exp|log2|log_determinant|log_diff_exp|log_falling_factorial|log_inv_logit|log_inv_logit_diff|log_mix|log_modified_bessel_first_kind|log_rising_factorial|log_softmax|log_sum_exp|logistic_cdf|logistic_lccdf|logistic_lcdf|logistic_lpdf|logistic_lupdf|logistic_rng|logit|loglogistic_cdf|loglogistic_lpdf|loglogistic_rng|lognormal_cdf|lognormal_lccdf|lognormal_lcdf|lognormal_lpdf|lognormal_lupdf|lognormal_rng|machine_precision|map_rect|matrix_exp|matrix_exp_multiply|matrix_power|max|mdivide_left_spd|mdivide_left_tri_low|mdivide_right_spd|mdivide_right_tri_low|mean|min|modified_bessel_first_kind|modified_bessel_second_kind|multi_gp_cholesky_lpdf|multi_gp_cholesky_lupdf|multi_gp_lpdf|multi_gp_lupdf|multi_normal_cholesky_lpdf|multi_normal_cholesky_lupdf|multi_normal_cholesky_rng|multi_normal_lpdf|multi_normal_lupdf|multi_normal_prec_lpdf|multi_normal_prec_lupdf|multi_normal_rng|multi_student_cholesky_t_rng|multi_student_t_cholesky_lpdf|multi_student_t_cholesky_lupdf|multi_student_t_cholesky_rng|multi_student_t_lpdf|multi_student_t_lupdf|multi_student_t_rng|multinomial_logit_lpmf|multinomial_logit_lupmf|multinomial_logit_rng|multinomial_lpmf|multinomial_lupmf|multinomial_rng|multiply_lower_tri_self_transpose|neg_binomial_2_cdf|neg_binomial_2_lccdf|neg_binomial_2_lcdf|neg_binomial_2_log_glm_lpmf|neg_binomial_2_log_glm_lupmf|neg_binomial_2_log_lpmf|neg_binomial_2_log_lupmf|neg_binomial_2_log_rng|neg_binomial_2_lpmf|neg_binomial_2_lupmf|neg_binomial_2_rng|neg_binomial_cdf|neg_binomial_lccdf|neg_binomial_lcdf|neg_binomial_lpmf|neg_binomial_lupmf|neg_binomial_rng|negative_infinity|norm|norm1|norm2|normal_cdf|normal_id_glm_lpdf|normal_id_glm_lupdf|normal_lccdf|normal_lcdf|normal_lpdf|normal_lupdf|normal_rng|not_a_number|num_elements|ode_adams|ode_adams_tol|ode_adjoint_tol_ctl|ode_bdf|ode_bdf_tol|ode_ckrk|ode_ckrk_tol|ode_rk45|ode_rk45_tol|one_hot_array|one_hot_int_array|one_hot_row_vector|one_hot_vector|ones_array|ones_int_array|ones_row_vector|ones_vector|ordered_logistic_glm_lpmf|ordered_logistic_glm_lupmf|ordered_logistic_lpmf|ordered_logistic_lupmf|ordered_logistic_rng|ordered_probit_lpmf|ordered_probit_lupmf|ordered_probit_rng|owens_t|pareto_cdf|pareto_lccdf|pareto_lcdf|pareto_lpdf|pareto_lupdf|pareto_rng|pareto_type_2_cdf|pareto_type_2_lccdf|pareto_type_2_lcdf|pareto_type_2_lpdf|pareto_type_2_lupdf|pareto_type_2_rng|pi|poisson_cdf|poisson_lccdf|poisson_lcdf|poisson_log_glm_lpmf|poisson_log_glm_lupmf|poisson_log_lpmf|poisson_log_lupmf|poisson_log_rng|poisson_lpmf|poisson_lupmf|poisson_rng|polar|positive_infinity|pow|prod|proj|qr|qr_Q|qr_R|qr_thin|qr_thin_Q|qr_thin_R|quad_form|quad_form_diag|quad_form_sym|quantile|rank|rayleigh_cdf|rayleigh_lccdf|rayleigh_lcdf|rayleigh_lpdf|rayleigh_lupdf|rayleigh_rng|reduce_sum|rep_array|rep_matrix|rep_row_vector|rep_vector|reverse|rising_factorial|round|row|rows|rows_dot_product|rows_dot_self|scale_matrix_exp_multiply|scaled_inv_chi_square_cdf|scaled_inv_chi_square_lccdf|scaled_inv_chi_square_lcdf|scaled_inv_chi_square_lpdf|scaled_inv_chi_square_lupdf|scaled_inv_chi_square_rng|sd|segment|sin|singular_values|sinh|size|skew_double_exponential_cdf|skew_double_exponential_lccdf|skew_double_exponential_lcdf|skew_double_exponential_lpdf|skew_double_exponential_lupdf|skew_double_exponential_rng|skew_normal_cdf|skew_normal_lccdf|skew_normal_lcdf|skew_normal_lpdf|skew_normal_lupdf|skew_normal_rng|softmax|sort_asc|sort_desc|sort_indices_asc|sort_indices_desc|sqrt|sqrt2|square|squared_distance|std_normal_cdf|std_normal_lccdf|std_normal_lcdf|std_normal_log_qf|std_normal_lpdf|std_normal_lupdf|std_normal_qf|std_normal_rng|step|student_t_cdf|student_t_lccdf|student_t_lcdf|student_t_lpdf|student_t_lupdf|student_t_rng|sub_col|sub_row|sum|svd|svd_U|svd_V|symmetrize_from_lower_tri|tail|tan|tanh|target|tcrossprod|tgamma|to_array_1d|to_array_2d|to_complex|to_int|to_matrix|to_row_vector|to_vector|trace|trace_gen_quad_form|trace_quad_form|trigamma|trunc|uniform_cdf|uniform_lccdf|uniform_lcdf|uniform_lpdf|uniform_lupdf|uniform_rng|uniform_simplex|variance|von_mises_cdf|von_mises_lccdf|von_mises_lcdf|von_mises_lpdf|von_mises_lupdf|von_mises_rng|weibull_cdf|weibull_lccdf|weibull_lcdf|weibull_lpdf|weibull_lupdf|weibull_rng|wiener_lpdf|wiener_lupdf|wishart_cholesky_lpdf|wishart_cholesky_lupdf|wishart_cholesky_rng|wishart_lpdf|wishart_lupdf|wishart_rng|zeros_array|zeros_int_array|zeros_row_vector)\\b\\s*\\(', name: 'support.function.function.stan' } ] }, + keywords: { + patterns: [ + {match: '\\b(for|in|while|if|else)\\b', name: 'keyword.control.stan'}, + { + captures: { + 1: {name: 'keyword.other.transform.stan'}, + 2: {name: 'punctuation.operator.equal.stan'} + }, + match: '\\b(lower|upper|offset|multiplier)\\s*(=)' + }, + {match: '\\breturn\\b', name: 'keyword.other.return.stan'}, + { + captures: { + 1: {name: 'keyword.other.target.stan'}, + 2: {name: 'keyword.operator.accumulator.stan'} + }, + match: '\\b(target)\\s*([+][=])' + }, + { + match: '\\b(print|reject|target|fatal_error)\\b', + name: 'keyword.other.special-functions.stan' + }, + {match: '\\bT(?=\\s*\\[)', name: 'keyword.other.truncation.stan'} + ] + }, numbers: { patterns: [ { @@ -216,7 +153,7 @@ const grammar = { name: 'constant.numeric.real.stan' }, { - match: '[0-9]+i?(_ [0-9]+)*(?=[^A-Za-z])', + match: '[0-9]+(_ [0-9]+)*(?=[^A-Za-z])', name: 'constant.numeric.integer.stan' } ] @@ -225,10 +162,15 @@ const grammar = { patterns: [ {match: '<-', name: 'invalid.deprecated.assignment.stan'}, {match: ':', name: 'keyword.operator.colon.stan'}, + {match: '~', name: 'keyword.operator.sampling.stan'}, {match: '[?]', name: 'keyword.operator.conditional.stan'}, {match: '[|]{2}|&&', name: 'keyword.operator.logical.stan'}, {match: '==|!=|<=?|>=?', name: 'keyword.operator.comparison.stan'}, {match: '!', name: 'keyword.operator.logical.stan'}, + { + match: "\\+|-|\\.?\\*|\\.?/|%|\\\\|\\^|'", + name: 'keyword.operator.arithmetic.stan' + }, {match: '[+-]=|\\.?[*/]=|=', name: 'keyword.operator.assignment.stan'}, { match: "\\+|-|\\.?\\*|\\.?/|%|\\\\|\\^|'", @@ -236,13 +178,21 @@ const grammar = { } ] }, - reserved: { + punctuation: { patterns: [ + {match: ',', name: 'meta.delimiter.comma.stan'}, { - match: - '\\b(for|in|while|repeat|until|if|then|else|true|false|var|struct|typedef|export|auto|extern|var|static)\\b', - name: 'invalid.illegal.reserved.stan' - } + begin: '{', + beginCaptures: {0: {name: 'punctuation.section.block.begin.stan'}}, + end: '}', + endCaptures: {0: {name: 'punctuation.section.block.end.stan'}}, + patterns: [{include: '$base'}] + }, + {match: '[{}]', name: 'meta.brace.curly.stan'}, + {match: '\\[|\\]', name: 'meta.brace.square.stan'}, + {match: '\\(|\\)', name: 'meta.brace.round.stan'}, + {match: '\\;', name: 'punctuation.terminator.statement.stan'}, + {match: '[|]', name: 'punctuation.sampling.bar.stan'} ] }, strings: { @@ -263,6 +213,29 @@ const grammar = { ] } ] + }, + types: { + patterns: [ + { + match: + '\\b(int|real|data|complex|array|tuple|vector|simplex|unit_vector|ordered|positive_ordered|row_vector|matrix|complex_vector|complex_matrix|complex_row_vector|corr_matrix|cov_matrix|cholesky_factor_cov|cholesky_factor_corr|void)\\b', + name: 'storage.type.stan' + } + ] + }, + variables: { + patterns: [ + { + match: + '\\b(for|in|while|repeat|until|if|then|else|true|false|var|struct|typedef|export|auto|extern|var|static)\\b', + name: 'invalid.illegal.reserved.stan' + }, + { + match: '\\b([a-zA-Z0-9_]*__|[0-9_][A-Za-z0-9_]+|_)\\b', + name: 'invalid.illegal.variable' + }, + {match: '\\b[A-Za-z][0-9A-Za-z_]*\\b'} + ] } }, scopeName: 'source.stan' diff --git a/lang/source.swift.js b/lang/source.swift.js index 293729b..88d1928 100644 --- a/lang/source.swift.js +++ b/lang/source.swift.js @@ -43,7 +43,7 @@ const grammar = { 2: {name: 'constant.numeric.swift'} }, match: - '\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?' + '\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?' }, { begin: '\\b(introduced|deprecated|obsoleted)\\s*(:)\\s*', @@ -412,7 +412,7 @@ const grammar = { 4: {name: 'punctuation.definition.parameters.end.swift'} }, match: - '\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))' + '\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|visionOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))' }, { captures: { @@ -1579,7 +1579,7 @@ const grammar = { 2: {name: 'constant.numeric.swift'} }, match: - '\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))' + '\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|visionOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))' }, { captures: { diff --git a/lang/source.sy.js b/lang/source.sy.js index 892aab0..d27f981 100644 --- a/lang/source.sy.js +++ b/lang/source.sy.js @@ -482,7 +482,7 @@ const grammar = { ] }, signature: { - match: '^(?:\\xC2\\xAD|\\xAD){2,}', + match: '^(?:\\xC2\\xAD){2,}', name: 'punctuation.whitespace.shy-hyphens.signature.sy' }, string: { diff --git a/lang/source.textproto.js b/lang/source.textproto.js index 2fa60d1..528656d 100644 --- a/lang/source.textproto.js +++ b/lang/source.textproto.js @@ -9,7 +9,7 @@ /** @type {Grammar} */ const grammar = { - extensions: ['.textproto', '.pbt', '.pbtxt'], + extensions: ['.textproto', '.pbtxt'], names: ['protocol-buffer-text-format', 'text-proto', 'protobuf-text-format'], patterns: [ {include: '#comments'}, diff --git a/lang/source.v.js b/lang/source.v.js index 24e9d7b..7155e96 100644 --- a/lang/source.v.js +++ b/lang/source.v.js @@ -9,8 +9,8 @@ /** @type {Grammar} */ const grammar = { - extensions: [], - names: ['v', 'vlang'], + extensions: ['.carbon'], + names: ['carbon', 'v', 'vlang'], patterns: [ {include: '#comments'}, {include: '#function-decl'}, diff --git a/lang/source.vba.js b/lang/source.vba.js index a8ccf43..4603a76 100644 --- a/lang/source.vba.js +++ b/lang/source.vba.js @@ -9,8 +9,19 @@ /** @type {Grammar} */ const grammar = { - extensions: ['.frm', '.vba'], - names: ['vba', 'visual-basic-for-applications'], + extensions: ['.bas', '.bas', '.bas', '.ctl', '.dsr', '.frm', '.frm', '.vba'], + names: [ + 'b4x', + 'basic-for-android', + 'classic-visual-basic', + 'vb-6', + 'vb6', + 'vba', + 'visual-basic-6', + 'visual-basic-6.0', + 'visual-basic-classic', + 'visual-basic-for-applications' + ], patterns: [ {include: '#comments'}, {include: '#functions'}, @@ -69,7 +80,7 @@ const grammar = { name: 'keyword.other.option.vba' }, { - match: '(?i:\\b(Private|Public|Friend)\\b)', + match: '(?i:\\b(Private|Public|Global|Friend)\\b)', name: 'keyword.other.visibility.vba' }, { diff --git a/lang/source.vbnet.js b/lang/source.vbnet.js index 348b466..653aab6 100644 --- a/lang/source.vbnet.js +++ b/lang/source.vbnet.js @@ -11,8 +11,6 @@ const grammar = { extensions: [ '.bi', - '.ctl', - '.dsr', '.rbbas', '.rbfrm', '.rbmnu', @@ -24,21 +22,15 @@ const grammar = { '.vbs' ], names: [ - 'classic-visual-basic', 'fb', 'freebasic', 'realbasic', 'vb-.net', - 'vb-6', 'vb.net', - 'vb6', 'vbnet', 'vbscript', 'visual-basic', - 'visual-basic-.net', - 'visual-basic-6', - 'visual-basic-6.0', - 'visual-basic-classic' + 'visual-basic-.net' ], patterns: [ {include: '#comment-single-quote'}, diff --git a/lang/source.vcard.js b/lang/source.vcard.js new file mode 100644 index 0000000..bddc8ac --- /dev/null +++ b/lang/source.vcard.js @@ -0,0 +1,73 @@ +// This is a TextMate grammar distributed by `starry-night`. +// This grammar is developed at +// +// and licensed `mit`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + extensions: [], + names: ['vcard', 'virtual-contact-file', 'electronic-business-card'], + patterns: [ + { + begin: '^BEGIN:VCARD$', + end: '^END:VCARD$', + name: 'support.function.vcard', + patterns: [ + {include: '#versionNum'}, + {include: '#properties'}, + {include: '#extensionProperties'}, + {include: '#attributeTypes'}, + {include: '#attributeValues'}, + {include: '#values'}, + {include: '#valuesMultiline'} + ] + } + ], + repository: { + attributeTypes: { + patterns: [ + { + match: '(?<=;)\\b\\w+?\\b(?=[:;=])', + name: 'entity.name.type.attribute.vcard' + } + ] + }, + attributeValues: { + patterns: [ + {match: '(?<=\\=).+?(?=[:;])', name: 'variable.attribute.vcard'} + ] + }, + extensionProperties: { + patterns: [ + {match: '^\\S.*?(?=:)', name: 'keyword.other.expansion.property.vcard'} + ] + }, + properties: { + patterns: [ + { + match: + '^\\b(VERSION|ADR|AGENT|ANNIVERSARY|BDAY|CALADRURI|CALURI|CATEGORIES|CLASS|CLIENTPIDMAP|EMAIL|FBURL|FN|GENDER|GEO|IMPP|KEY|KIND|LABEL|LANG|LOGO|MAILER|MEMBER|N|NAME|NICKNAME|NOTE|ORG|PHOTO|PRODID|PROFILE|RELATED|REV|ROLE|SORT-STRING|SOUND|SOURCE|TEL|TITLE|TZ|UID|URL|XML)\\b', + name: 'keyword.control.property.vcard' + } + ] + }, + values: { + patterns: [{match: '(?<=:).+', name: 'string.unquoted.value.vcard'}] + }, + valuesMultiline: { + patterns: [{match: '^ \\S.*', name: 'string.unquoted.value.vcard'}] + }, + versionNum: { + patterns: [ + {match: '(?<=^VERSION:).+$', name: 'variable.language.version.vcard'} + ] + } + }, + scopeName: 'source.vcard' +} + +export default grammar diff --git a/lang/source.viml.js b/lang/source.viml.js index f4126b2..25223c2 100644 --- a/lang/source.viml.js +++ b/lang/source.viml.js @@ -10,7 +10,7 @@ /** @type {Grammar} */ const grammar = { extensions: ['.vim', '.vimrc', '.vmb'], - names: ['vim-script', 'vim', 'viml', 'nvim'], + names: ['vim-script', 'vim', 'viml', 'nvim', 'vimscript'], patterns: [ { begin: '\\A(?=" Vimball Archiver)', diff --git a/lang/source.wdl.js b/lang/source.wdl.js index 5d32625..517bfd1 100644 --- a/lang/source.wdl.js +++ b/lang/source.wdl.js @@ -1,7 +1,7 @@ // This is a TextMate grammar distributed by `starry-night`. // This grammar is developed at -// -// and licensed `bsd-3-clause`. +// +// and licensed `apache-2.0`. // See for more info. /** * @import {Grammar} from '@wooorm/starry-night' @@ -12,136 +12,242 @@ const grammar = { extensions: ['.wdl'], names: ['wdl', 'workflow-description-language'], patterns: [ - {match: '\\=', name: 'keyword.operator.assignment.wdl'}, + {include: '#single-number-sign-comment'}, + {include: '#double-number-sign-comment'}, { - match: '<\\=|>\\=|\\=\\=|<|>|\\!\\=', - name: 'keyword.operator.comparison.wdl' + captures: { + 1: {name: 'keyword.other.version.wdl'}, + 2: {name: 'entity.version.number.wdl'} + }, + match: '(version)\\s+(.*)', + name: 'entity.version.wdl' }, { - match: - '\\+\\=|-\\=|\\*\\=|/\\=|//\\=|%\\=|&\\=|\\|\\=|\\^\\=|>>\\=|<<\\=|\\*\\*\\=', - name: 'keyword.operator.assignment.augmented.wdl' + begin: '(struct)\\s+([A-Za-z][A-Za-z0-9_]+)?', + beginCaptures: { + 1: {name: 'storage.type.struct.wdl'}, + 2: {name: 'variable.name.struct.wdl'} + }, + contentName: 'entity.struct.wdl', + end: '({)', + endCaptures: {1: {name: 'punctuation.bracket.angle.struct-start.wdl'}}, + patterns: [{include: '#atom'}] + }, + { + begin: '(task)\\s+([A-Za-z][A-Za-z0-9_]+)?', + beginCaptures: { + 1: {name: 'storage.type.task.wdl'}, + 2: {name: 'variable.name.task.wdl'} + }, + contentName: 'entity.task.wdl', + end: '({)', + endCaptures: {1: {name: 'punctuation.bracket.angle.task-start.wdl'}}, + patterns: [{include: '#atom'}] }, { - match: '\\+|\\-|\\*|\\*\\*|/|//|%|<<|>>|&|\\||\\^|~', - name: 'keyword.operator.arithmetic.wdl' - }, - {match: '\\b(true|false)\\b', name: 'constant.language.wdl'}, - {include: '#builtin_types'}, - {include: '#comments'}, - {include: '#input_output'}, - {include: '#keywords'}, - {include: '#string_quoted_single'}, - {include: '#string_quoted_double'}, - {include: '#command_block'} + begin: '(workflow)\\s+([A-Za-z][A-Za-z0-9_]+)', + beginCaptures: { + 1: {name: 'storage.type.workflow.wdl'}, + 2: {name: 'variable.name.workflow.wdl'} + }, + end: '({)', + endCaptures: {1: {name: 'punctuation.bracket.angle.workflow-start.wdl'}}, + patterns: [{include: '#atom'}] + }, + {include: '#input-block'}, + {include: '#command-block'}, + {include: '#output-block'}, + {include: '#requirements-block'}, + {include: '#hints-block'}, + {include: '#runtime-block'}, + {include: '#meta-block'}, + {include: '#parameter_meta-block'}, + {include: '#atom'} ], repository: { - builtin_types: { - match: - '(?{3}', - name: 'command.block.wdl' - } + {include: '#double-number-sign-comments'}, + {include: '#single-number-sign-comments'}, + {include: '#numeric'}, + {include: '#strings'}, + {include: '#keywords'}, + {include: '#identity'} ] }, - comments: { + 'command-block': { + begin: '(?:\\s*)(command)\\s+(?:(<<<)|({))', + beginCaptures: { + 1: {name: 'storage.type.command.wdl'}, + 2: {name: 'punctuation.heredoc.command-start.wdl'}, + 3: {name: 'punctuation.bracket.angle.command-start.wdl'} + }, + contentName: 'meta.embedded.block.shellscript', + end: '(?:^|\\G)(?:\\s*)(?:(>>>)|(}))(?:\\s*)$', + endCaptures: { + 1: {name: 'punctuation.heredoc.command-end.wdl'}, + 2: {name: 'punctuation.bracket.angle.command-end.wdl'} + }, patterns: [ { - captures: {1: {name: 'punctuation.definition.comment.wdl'}}, - match: '(#).*$\\n?', - name: 'comment.line.number-sign.wdl' + begin: '(^|\\G)(\\s*)(.*)', + contentName: 'meta.embedded.block.shellscript', + patterns: [{include: 'source.shell'}], + while: '(^|\\G)(?!\\s*(?:(>>>)|(}))\\s*$)' } ] }, - constant_placeholder: { - match: - '(?i:%(\\([a-z_]+\\))?#?0?\\-?[ ]?\\+?([0-9]*|\\*)(\\.([0-9]*|\\*))?[hL]?[a-z%])', - name: 'constant.other.placeholder.wdl' + 'double-number-sign-comments': { + begin: '(?:\\s*)(?:##) ?', + name: 'comment.line.double-number-sign.documentation', + patterns: [{include: 'source.gfm'}], + while: '(?:^|\\G)\\s*(?:##) ?' + }, + 'double-quoted-strings': { + begin: '"', + end: '"', + name: 'string.quoted.double.wdl', + patterns: [{include: '#placeholder'}, {include: '#escaped-character'}] }, - escaped_char: { + 'escaped-character': { captures: { - 1: {name: 'constant.character.escape.hex.wdl'}, - 10: {name: 'constant.character.escape.linefeed.wdl'}, - 11: {name: 'constant.character.escape.return.wdl'}, - 12: {name: 'constant.character.escape.tab.wdl'}, - 13: {name: 'constant.character.escape.vertical-tab.wdl'}, - 2: {name: 'constant.character.escape.octal.wdl'}, - 3: {name: 'constant.character.escape.newline.wdl'}, - 4: {name: 'constant.character.escape.backlash.wdl'}, + 1: {name: 'constant.character.escape.backslash.wdl'}, + 10: {name: 'constant.character.escape.four-byte-unicode.wdl'}, + 11: {name: 'constant.character.escape.eight-byte-unicode.wdl'}, + 2: {name: 'constant.character.escape.newline.wdl'}, + 3: {name: 'constant.character.escape.tab.wdl'}, + 4: {name: 'constant.character.escape.single-quote.wdl'}, 5: {name: 'constant.character.escape.double-quote.wdl'}, - 6: {name: 'constant.character.escape.single-quote.wdl'}, - 7: {name: 'constant.character.escape.bell.wdl'}, - 8: {name: 'constant.character.escape.backspace.wdl'}, - 9: {name: 'constant.character.escape.formfeed.wdl'} + 6: {name: 'constant.character.escape.tilde.wdl'}, + 7: {name: 'constant.character.escape.dollar-sign.wdl'}, + 8: {name: 'constant.character.escape.octal.wdl'}, + 9: {name: 'constant.character.escape.hex.wdl'} }, match: - '(\\\\x[0-9a-fA-F]{2})|(\\\\[0-7]{3})|(\\\\\\n)|(\\\\\\\\)|(\\\\\\")|(\\\\\')|(\\\\a)|(\\\\b)|(\\\\f)|(\\\\n)|(\\\\r)|(\\\\t)|(\\\\v)' + '(\\\\\\\\)|(\\\\n)|(\\\\t)|(\\\\\')|(\\\\")|(\\\\~)|(\\\\\\$)|(\\\\[0-7]{3})|(\\\\x[0-9a-fA-F]{2})|(\\\\u[0-9a-fA-F]{4})|(\\\\U[0-9a-fA-F]{8})', + name: 'constant.character.escape.wdl' }, - escaped_unicode_char: { - captures: { - 1: {name: 'constant.character.escape.unicode.16-bit-hex.wdl'}, - 2: {name: 'constant.character.escape.unicode.32-bit-hex.wdl'}, - 3: {name: 'constant.character.escape.unicode.name.wdl'} - }, - match: - '(\\\\U[0-9A-Fa-f]{8})|(\\\\u[0-9A-Fa-f]{4})|(\\\\N\\{[a-zA-Z0-9\\, ]+\\})' + 'hints-block': { + begin: '(?:\\s*)(hints)', + beginCaptures: {1: {name: 'keyword.other.hints.wdl'}}, + end: '(?:\\s*)({)', + endCaptures: {1: {name: 'punctuation.bracket.angle.hints-start.wdl'}}, + name: 'entity.hints-block.wdl', + patterns: [{include: '#atom'}] + }, + identity: { + match: '\\b[A-Za-z][A-Za-z0-9_]*\\b', + name: 'variable.other.wdl' + }, + 'input-block': { + begin: '(?:\\s*)(input)[?=\\s|{i]', + beginCaptures: {1: {name: 'keyword.other.input.wdl'}}, + end: '(?:\\s*)({)', + endCaptures: {1: {name: 'punctuation.bracket.angle.input-start.wdl'}}, + name: 'entity.input-block.wdl', + patterns: [{include: '#atom'}] }, keywords: { patterns: [ + {match: '\\b(import|version)\\b', name: 'keyword.other.wdl'}, + {match: '\\b(alias|as|in|scatter)\\b', name: 'storage.modifier.wdl'}, + {match: '\\b(call|else|if|then)\\b', name: 'keyword.control.wdl'}, { match: - '(^|\\s)(call|runtime|task|workflow|if|then|else|import|as|input|output|meta|parameter_meta|scatter)[^A-Za-z_]', - name: 'keyword.other.wdl' - } - ] - }, - string_quoted_double: { - patterns: [ + '\\b(command|hints|inputs|meta|object|outputs|parameter_meta|requirements|runtime|struct|task|workflow)\\b\\s*(?!:)', + name: 'storage.type' + }, { - begin: '(")', - beginCaptures: {1: {name: 'punctuation.definition.string.begin.wdl'}}, - end: '(")', - endCaptures: { - 1: {name: 'punctuation.definition.string.end.wdl'}, - 2: {name: 'invalid.illegal.unclosed-string.wdl'} - }, - name: 'string.quoted.double.single-line.wdl', - patterns: [ - {include: '#constant_placeholder'}, - {include: '#escaped_char'} - ] + match: '\\b(true|false|left|right|null)\\b', + name: 'constant.language.wdl' + }, + { + match: + '\\b(alias|as|call|command|else|false|hints|if|in|import|input|left|meta|object|output|parameter_meta|right|hint|runtime|scatter|struct|task|then|true|version|workflow)\\b\\s*(?!:)', + name: 'keyword.wdl' + }, + { + match: + '\\b(Array|Boolean|Directory|File|Float|Int|Map|None|Object|Pair|String)\\b', + name: 'entity.name.type.wdl' } ] }, - string_quoted_single: { + 'meta-block': { + begin: '(?:\\s*)(meta)', + beginCaptures: {1: {name: 'keyword.other.meta.wdl'}}, + end: '(?:\\s*)({)', + endCaptures: {1: {name: 'punctuation.bracket.angle.meta-start.wdl'}}, + name: 'entity.meta-block.wdl', + patterns: [{include: '#atom'}] + }, + 'multi-line-strings': { + begin: '<<<', + end: '>>>', + name: 'string.unquoted.multi-line.wdl', + patterns: [{include: '#placeholder'}, {include: '#escaped-character'}] + }, + numeric: { + match: + '-?(?:[0-9]+\\.[0-9]*(e|E)?|[0-9]+(e|E)?|[1-9][0-9]*|0[0-7]+|0[xX][0-9a-fA-F]|0)', + name: 'constant.numeric.wdl' + }, + 'output-block': { + begin: '(?:\\s*)(output)[?=\\s|{]', + beginCaptures: {1: {name: 'keyword.other.output.wdl'}}, + end: '(?:\\s*)({)', + endCaptures: {1: {name: 'punctuation.bracket.angle.output-start.wdl'}}, + name: 'entity.output-block.wdl', + patterns: [{include: '#atom'}] + }, + 'parameter_meta-block': { + begin: '(?:\\s*)(parameter_meta)', + beginCaptures: {1: {name: 'keyword.other.parameter_meta.wdl'}}, + end: '(?:\\s*)({)', + endCaptures: { + 1: {name: 'punctuation.bracket.angle.parameter_meta-start.wdl'} + }, + name: 'entity.parameter_meta-block.wdl', + patterns: [{include: '#atom'}] + }, + placeholder: { + match: '[$~]{\\s*([A-Za-z][A-Za-z0-9_]*)\\s*}', + name: 'constant.other.placeholder.wdl' + }, + 'requirements-block': { + begin: '(?:\\s*)(requirements)', + beginCaptures: {1: {name: 'keyword.other.requirements.wdl'}}, + end: '(?:\\s*)({)', + endCaptures: { + 1: {name: 'punctuation.bracket.angle.requirements-start.wdl'} + }, + name: 'entity.requirements-block.wdl', + patterns: [{include: '#atom'}] + }, + 'runtime-block': { + begin: '(?:\\s*)(runtime)', + beginCaptures: {1: {name: 'keyword.other.runtime.wdl'}}, + end: '(?:\\s*)({)', + endCaptures: {1: {name: 'punctuation.bracket.angle.runtime-start.wdl'}}, + name: 'entity.runtime-block.wdl', + patterns: [{include: '#atom'}] + }, + 'single-number-sign-comments': { + begin: '(?:\\s*)(?:#(?!#))', + name: 'comment.line.number-sign.documentation', + while: '(?:^|\\G)(?:\\s*)(?:#(?!#))' + }, + 'single-quoted-strings': { + begin: "'", + end: "'", + name: 'string.quoted.single.wdl', + patterns: [{include: '#placeholder'}, {include: '#escaped-character'}] + }, + strings: { patterns: [ - { - begin: "(')", - beginCaptures: {1: {name: 'punctuation.definition.string.begin.wdl'}}, - end: "(')", - endCaptures: { - 1: {name: 'punctuation.definition.string.end.wdl'}, - 2: {name: 'invalid.illegal.unclosed-string.wdl'} - }, - name: 'string.quoted.single.single-line.wdl', - patterns: [ - {include: '#constant_placeholder'}, - {include: '#escaped_char'} - ] - } + {include: '#single-quoted-strings'}, + {include: '#double-quoted-strings'}, + {include: '#multi-line-strings'} ] } }, diff --git a/lang/text.adblock.js b/lang/text.adblock.js index 517be09..ef0d39e 100644 --- a/lang/text.adblock.js +++ b/lang/text.adblock.js @@ -597,7 +597,8 @@ const grammar = { 2: { patterns: [ { - match: '(all|general|privacy|social|security|other|custom)', + match: + '(all|general|privacy|social|security|other|custom|advanced)', name: 'constant.language.contentblocker.name' }, {match: '(\\(|\\)|,)', name: 'keyword.control.characters'}, diff --git a/lang/text.html.jte.js b/lang/text.html.jte.js new file mode 100644 index 0000000..d2bfbd3 --- /dev/null +++ b/lang/text.html.jte.js @@ -0,0 +1,311 @@ +// This is a TextMate grammar distributed by `starry-night`. +// This grammar is developed at +// +// and licensed `apache-2.0`. +// See for more info. +/** + * @import {Grammar} from '@wooorm/starry-night' + */ + +/** @type {Grammar} */ +const grammar = { + dependencies: ['source.java', 'text.html.basic'], + extensions: ['.jte'], + names: ['java-template-engine', 'jte'], + patterns: [ + {include: '#jte-comment'}, + {include: '#jte-statement'}, + {include: '#jte-declaration'}, + {include: '#jte-comparison'}, + {include: '#html_tags'}, + {include: 'text.html.basic'} + ], + repository: { + entities: { + patterns: [ + { + captures: { + 1: {name: 'punctuation.definition.entity.html'}, + 3: {name: 'punctuation.definition.entity.html'} + }, + match: '(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)', + name: 'constant.character.entity.html' + }, + {match: '&', name: 'invalid.illegal.bad-ampersand.html'} + ] + }, + 'escaped-double-quote': { + match: '\\\\"', + name: 'constant.character.escape.js' + }, + 'escaped-single-quote': { + match: "\\\\'", + name: 'constant.character.escape.js' + }, + html_tags: { + patterns: [ + { + begin: '(<)([a-zA-Z0-9:-]+)(?=[^>]*>)', + beginCaptures: { + 1: {name: 'punctuation.definition.tag.html'}, + 2: {name: 'entity.name.tag.html'} + }, + end: '(>(<)/)(\\2)(>)', + endCaptures: { + 1: {name: 'punctuation.definition.tag.html'}, + 2: {name: 'meta.scope.between-tag-pair.html'}, + 3: {name: 'entity.name.tag.html'}, + 4: {name: 'punctuation.definition.tag.html'} + }, + name: 'meta.tag.any.html', + patterns: [{include: '#tag-stuff'}] + }, + { + begin: '(<\\?)(xml)', + captures: { + 1: {name: 'punctuation.definition.tag.html'}, + 2: {name: 'entity.name.tag.xml.html'} + }, + end: '(\\?>)', + name: 'meta.tag.preprocessor.xml.html', + patterns: [{include: '#tag_generic_attribute'}, {include: '#string'}] + }, + { + begin: '