// 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.regexp.posix'], extensions: [], names: [], patterns: [ {include: '#comma'}, {include: '#comment'}, {include: '#esc'}, {include: '#float'}, {include: '#int'}, {include: '#str'}, {include: '#colon'}, {include: '#eql'}, {include: '#dot'} ], repository: { bareword: {match: '[^"\\s][\\S]*', name: 'string.unquoted.bareword'}, base64: {match: '[A-Za-z0-9+/=]{4,}', name: 'constant.numeric.base64'}, bool: { match: '\\b(true|false|TRUE|FALSE)\\b', name: 'constant.logical.bool.boolean.${1:/downcase}' }, boolish: { match: '(?i)\\b(true|false|yes|no|on|off)\\b', name: 'constant.logical.bool.boolean.${1:/downcase}' }, bracket: { patterns: [ { match: '\\{', name: 'punctuation.definition.bracket.curly.brace.begin' }, {match: '\\}', name: 'punctuation.definition.bracket.curly.brace.end'}, {match: '\\[', name: 'punctuation.definition.bracket.square.begin'}, {match: '\\]', name: 'punctuation.definition.bracket.square.end'}, { match: '\\(', name: 'punctuation.definition.bracket.round.parenthesis.begin' }, { match: '\\)', name: 'punctuation.definition.bracket.round.parenthesis.end' }, {match: '<', name: 'punctuation.definition.bracket.angle.ascii.begin'}, {match: '>', name: 'punctuation.definition.bracket.angle.ascii.end'}, { match: '⟨', name: 'punctuation.definition.bracket.angle.unicode.begin' }, {match: '⟩', name: 'punctuation.definition.bracket.angle.unicode.end'} ] }, colon: {match: ':', name: 'punctuation.delimiter.separator.colon'}, comma: {match: ',', name: 'punctuation.separator.delimiter.comma'}, comment: {patterns: [{include: '#commentHash'}]}, commentHash: { begin: '#', beginCaptures: {0: {name: 'punctuation.definition.comment'}}, end: '$', name: 'comment.line.number-sign' }, commentSemi: { begin: ';+', beginCaptures: {0: {name: 'punctuation.definition.comment'}}, end: '$', name: 'comment.line.semicolon' }, commentSlash: { begin: '//', beginCaptures: {0: {name: 'punctuation.definition.comment'}}, end: '$', name: 'comment.line.double-slash' }, dash: {match: '-', name: 'punctuation.delimiter.separator.dash.hyphen'}, dot: { match: '\\.', name: 'punctuation.delimiter.separator.property.period.dot' }, dotDec: { match: '(?:\\G|(?@\\s]+@[^>@\\s]+)\\s*(>)', name: 'meta.email-address.bracketed.ascii.angle-brackets' }, { captures: { 1: {patterns: [{include: '#bracket'}]}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {patterns: [{include: '#bracket'}]} }, match: '(⟨)\\s*([^⟩@\\s]+@[^⟩@\\s]+)\\s*(⟩)', name: 'meta.email-address.bracketed.unicode.angle-brackets' }, { captures: { 1: {patterns: [{include: '#bracket'}]}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {patterns: [{include: '#bracket'}]} }, match: '(«)\\s*([^»@\\s]+@[^»@\\s]+)\\s*(»)', name: 'meta.email-address.bracketed.guillemots' }, { captures: { 1: {patterns: [{include: '#bracket'}]}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {patterns: [{include: '#bracket'}]} }, match: '(\\()\\s*([^\\)@\\s]+@[^\\)@\\s]+)\\s*(\\))', name: 'meta.email-address.bracketed.round-brackets' }, { captures: { 1: {patterns: [{include: '#bracket'}]}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {patterns: [{include: '#bracket'}]} }, match: '({)\\s*([^}@\\s]+@[^}@\\s]+)\\s*(})', name: 'meta.email-address.bracketed.curly-brackets' }, { captures: { 1: {patterns: [{include: '#bracket'}]}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {patterns: [{include: '#bracket'}]} }, match: '(\\[)\\s*([^\\]@\\s]+@[^\\]@\\s]+)\\s*(\\])', name: 'meta.email-address.bracketed.square-brackets' } ] }, emailInnards: { captures: { 0: { patterns: [ { captures: { 1: {name: 'meta.local-part'}, 2: {name: 'punctuation.separator.at-sign.email'}, 3: {name: 'meta.domain'} }, match: '\\G([^@]*)(@)(.*)' } ] } }, match: '(?:\\G|^|(?<=\\n)).+', name: 'constant.other.reference.link.underline.email' }, emailQuoted: { patterns: [ { captures: { 0: {name: 'string.quoted.double'}, 1: {name: 'punctuation.definition.string.begin.email-address'}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {name: 'punctuation.definition.string.end.email-address'} }, match: '(")\\s*([^"@\\s]+@[^"@\\s]+)\\s*(")', name: 'meta.email-address.quoted.ascii.double-quotes' }, { captures: { 0: {name: 'string.quoted.double'}, 1: {name: 'punctuation.definition.string.begin.email-address'}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {name: 'punctuation.definition.string.end.email-address'} }, match: '(“)\\s*([^”@\\s]+@[^”@\\s]+)\\s*(”)', name: 'meta.email-address.quoted.unicode.double-quotes' }, { captures: { 0: {name: 'string.quoted.single'}, 1: {name: 'punctuation.definition.string.begin.email-address'}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {name: 'punctuation.definition.string.end.email-address'} }, match: '(‘)\\s*([^’@\\s]+@[^’@\\s]+)\\s*(’)', name: 'meta.email-address.quoted.unicode.single-quotes' }, { captures: { 0: {name: 'string.quoted.template.backticks'}, 1: {name: 'punctuation.definition.string.begin.email-address'}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {name: 'punctuation.definition.string.end.email-address'} }, match: '(`)\\s*([^`@\\s]+@[^`@\\s]+)\\s*(`)', name: 'meta.email-address.quoted.backticks' }, { captures: { 0: {name: 'string.quoted.single'}, 1: {name: 'punctuation.definition.string.begin.email-address'}, 2: {patterns: [{include: '#emailInnards'}]}, 3: {name: 'punctuation.definition.string.end.email-address'} }, match: "(`|')\\s*([^'@\\s]+@[^'@\\s]+)\\s*(')", name: 'meta.email-address.quoted.single-quotes' } ] }, emailUnquoted: { captures: { 1: { name: 'string.unquoted.email-address', patterns: [{include: '#emailInnards'}] } }, match: '(?x)\n((?!\\.) (?:[^\\[\\(<⟨«"\'\\s@.]|\\.(?!\\.))++ @\n([^\\[\\(<⟨«"\'\\s@.]+?\\.(?=[^\\.\\s])(?:[^\\[\\(<⟨«"\'\\s@.]|\\.(?!\\.))++))', name: 'meta.email-address.unquoted' }, eql: { match: '=', name: 'keyword.operator.assignment.key-value.equals-sign' }, esc: { captures: {1: {name: 'punctuation.definition.escape.backslash'}}, match: '(\\\\).', name: 'constant.character.escape.backslash' }, float: {patterns: [{include: '#floatExp'}, {include: '#floatNoExp'}]}, floatExp: { match: '[-+]?(?:[0-9]*\\.[0-9]+|[0-9]+\\.)(?:[eE][-+]?[0-9]+)++', name: 'constant.numeric.float.real.decimal.dec.exponential.scientific' }, floatNoExp: { match: '[-+]?(?:[0-9]*\\.[0-9]+|[0-9]+\\.)++', name: 'constant.numeric.float.real.decimal.dec' }, glob: { patterns: [ {include: '#globSimple'}, {include: '#globSet'}, {include: '#globBraces'} ] }, globBraces: { patterns: [{include: '#globBracesSeq'}, {include: '#globBracesAlt'}] }, globBracesAlt: { captures: { 0: { patterns: [ {include: '#globBracesSeq'}, { captures: {0: {patterns: [{include: '#esc'}]}}, match: '{(?:\\.?+(?:[^{},.\\\\]|\\\\.))*+}' }, {include: '#esc'}, {include: '#globSet'}, {include: '#globSimple'}, { captures: { 1: {patterns: [{include: '#bracket'}]}, 2: {patterns: [{include: '#comma'}]} }, match: '({|})|(,)' } ] } }, match: '(?x)\n(?[^\\s{,}\\\\]|\\\\[{,}\\\\]|\\g){0}\n(?{(?:[^{},\\\\]|\\\\.)*+}){0}\n(?\\g*+,\\g*+|\\g++){0}\n(?{(?:-?\\d+\\.\\.-?\\d+|[a-zA-Z]\\.\\.[a-zA-Z])(?:\\.\\.-?\\d+)?}){0}\n(? \\g*+ (?:\n\t\\g+\n\t|\n\t(?!\\g)\n\t{\n\t\t(?\n\t\t\t\\g*+\n\t\t\t(?:(?!\\g) { \\g*+ } | \\g++)\n\t\t\t\\g*+\n\t\t\t|\n\t\t\t\\g++\n\t\t)\n\t}\n) \\g*+)', name: 'meta.brace-expansion.alternation' }, globBracesSeq: { captures: { 1: {patterns: [{include: 'etc#bracket'}]}, 2: { name: 'meta.range.numeric', patterns: [{include: '#dots'}, {include: '#intNoExp'}] }, 3: { name: 'meta.range.alphabetic', patterns: [ {include: '#dots'}, {match: '\\w', name: 'constant.character.letter'} ] }, 4: { name: 'meta.increment', patterns: [{include: '#dots'}, {include: '#intNoExp'}] }, 5: {patterns: [{include: 'etc#bracket'}]} }, match: '({)(?:(-?\\d+\\.\\.-?\\d+)|([a-zA-Z]\\.\\.[a-zA-Z]))(\\.\\.-?\\d+)?(})', name: 'meta.brace-expansion.sequence' }, globSet: { captures: { 1: { name: 'brackethighlighter.square.punctuation.definition.character-class.set.begin' }, 2: {name: 'keyword.operator.logical.not'}, 3: { patterns: [ {include: '#esc'}, { captures: { 1: {patterns: [{include: '#dash'}]}, 2: {name: 'constant.character.single'} }, match: '(?!^|\\G)(-)(?!\\])(-)?' }, {include: 'source.regexp.posix#charClass'}, {include: 'source.regexp.posix#localeClasses'}, {match: '.', name: 'constant.character.single'} ] }, 4: { name: 'brackethighlighter.square.punctuation.definition.character-class.set.end' } }, match: '(?x)\n(\\[) (!|\\^)?\n(\n\t(?: [^\\\\\\[\\]]\n\t| \\\\.\n\t| \\[ (?::[!^]?\\w+:|\\..+?\\.|=.+?=) \\]\n\t)*+\n)(\\])', name: 'meta.character-class.set' }, globSimple: { patterns: [ {match: '\\*{2}', name: 'keyword.operator.glob.wildcard.globstar'}, {match: '[*?]', name: 'keyword.operator.glob.wildcard'} ] }, hex: { match: '[-+]?[A-Fa-f0-9]+', name: 'constant.numeric.integer.int.hexadecimal.hex' }, hexNoSign: { match: '[A-Fa-f0-9]+', name: 'constant.numeric.integer.int.hexadecimal.hex' }, int: {patterns: [{include: '#intExp'}, {include: '#intNoExp'}]}, intExp: { match: '[-+]?[0-9]+[eE][-+]?[0-9]+', name: 'constant.numeric.integer.int.decimal.dec.exponential.scientific' }, intNoExp: { match: '[-+]?[0-9]+', name: 'constant.numeric.integer.int.decimal.dec' }, ip: {patterns: [{include: '#ipv6'}, {include: '#ipv4'}]}, ipv4: { captures: { 1: {patterns: [{include: '#dot'}]}, 2: {name: 'meta.cidr-notation'}, 3: {name: 'keyword.operator.assignment.cidr'}, 4: {patterns: [{include: '#intNoExp'}]} }, match: '(?x) (?:\\G|^|(?25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]?\\d){0}\n(?[A-F0-9]{1,4}){0}\n(?\\g(?:\\.\\g){3}){0}\n(?\\g:){0}\n\n# Address\n(?: \\g{7} (?: \\g |:)\n| \\g{6} (?: \\g| :\\g |:)\n| \\g{5} (?: :\\g|(?::\\g){1,2}|:)\n| \\g{4} (?:(?::\\g)? :\\g|(?::\\g){1,3}|:)\n| \\g{3} (?:(?::\\g){0,2}:\\g|(?::\\g){1,4}|:)\n| \\g{2} (?:(?::\\g){0,3}:\\g|(?::\\g){1,5}|:)\n| \\g (?:(?::\\g){0,4}:\\g|(?::\\g){1,6}|:)\n| (?::(?:(?::\\g){0,5}:\\g|(?::\\g){1,7}|:))\n) (?:(?>>', name: 'keyword.operator.bitwise.shift.right.unsigned'}, {match: '>>', name: 'keyword.operator.bitwise.shift.right.signed'} ] }, opBitAssign: { patterns: [ {match: '\\^=', name: 'keyword.operator.assignment.bitwise.xor'}, {match: '~=', name: 'keyword.operator.assignment.bitwise.not'}, {match: '&=', name: 'keyword.operator.assignment.bitwise.and'}, {match: '\\|=', name: 'keyword.operator.assignment.bitwise.or'}, {match: '<<=', name: 'keyword.operator.assignment.bitwise.shift.left'}, { match: '>>>=', name: 'keyword.operator.assignment.bitwise.shift.right.unsigned' }, { match: '>>=', name: 'keyword.operator.assignment.bitwise.shift.right.signed' } ] }, opCmp: { patterns: [ { match: '<=>', name: 'keyword.operator.logical.comparison.starship.spaceship' }, { match: '<=', name: 'keyword.operator.logical.comparison.less-than-or-equal-to.lte' }, {match: '<', name: 'keyword.operator.logical.comparison.less-than.lt'}, { match: '>=', name: 'keyword.operator.logical.comparison.greater-than-or-equal-to.gte' }, { match: '>', name: 'keyword.operator.logical.comparison.greater-than.gt' }, { match: '===', name: 'keyword.operator.logical.comparison.equal-to.equals.equal.eql.eq.strict' }, { match: '==', name: 'keyword.operator.logical.comparison.equal-to.equals.equal.eql.eq' }, { match: '!==', name: 'keyword.operator.logical.comparison.not-equal-to.not-equal.unequal.neql.ne.strict' }, { match: '!=', name: 'keyword.operator.logical.comparison.not-equal-to.not-equal.unequal.neql.ne' } ] }, opFix: { patterns: [ {match: '\\+{2}', name: 'keyword.operator.increment'}, {match: '-{2}', name: 'keyword.operator.decrement'} ] }, opLog: { patterns: [ {match: '!!', name: 'keyword.operator.logical.boolean.cast'}, { match: '!', name: 'keyword.operator.logical.boolean.not.negation.negate' }, {match: '&&', name: 'keyword.operator.logical.boolean.and'}, {match: '\\|{2}', name: 'keyword.operator.logical.boolean.or'}, {match: '\\?{2}', name: 'keyword.operator.logical.boolean.or.nullish'} ] }, opMath: { patterns: [ { match: '\\*{2}|\\^', name: 'keyword.operator.arithmetic.exponentiation.exponent.exp.power' }, {match: '\\+', name: 'keyword.operator.arithmetic.addition.add.plus'}, { match: '\\*', name: 'keyword.operator.arithmetic.multiplication.multiply.times' }, {match: '/', name: 'keyword.operator.arithmetic.division.divide'}, { match: '%', name: 'keyword.operator.arithmetic.remainder.modulo.modulus.mod' }, { match: '[-֊־᐀᠆‐-―⸗⸚⸺⸻⹀〜〰゠︱︲﹘﹣-]', name: 'keyword.operator.arithmetic.subtraction.subtract.minus' } ] }, opMathAssign: { patterns: [ { match: '\\*{2}=|\\^=', name: 'keyword.operator.assignment.arithmetic.exponentiation.exponent.exp.power' }, { match: '\\+=', name: 'keyword.operator.assignment.arithmetic.addition.add.plus' }, { match: '\\*=', name: 'keyword.operator.assignment.arithmetic.multiplication.multiply.times' }, { match: '/=', name: 'keyword.operator.assignment.arithmetic.division.divide' }, { match: '%=', name: 'keyword.operator.assignment.arithmetic.remainder.modulo.modulus.mod' }, { match: '[-֊־᐀᠆‐-―⸗⸚⸺⸻⹀〜〰゠︱︲﹘﹣-]=', name: 'keyword.operator.assignment.arithmetic.subtraction.subtract.minus' } ] }, semi: {match: ';', name: 'punctuation.delimiter.separator.semicolon'}, str: {patterns: [{include: '#strDouble'}, {include: '#strSingle'}]}, strDouble: { begin: '"', beginCaptures: {0: {name: 'punctuation.definition.string.begin'}}, end: '"|(?=$)', endCaptures: {0: {name: 'punctuation.definition.string.end'}}, name: 'string.quoted.double', patterns: [{include: '#esc'}] }, strSingle: { begin: "'", beginCaptures: {0: {name: 'punctuation.definition.string.begin'}}, end: "'|(?=$)", endCaptures: {0: {name: 'punctuation.definition.string.end'}}, name: 'string.quoted.single', patterns: [{include: '#esc'}] }, tab: { patterns: [ { captures: { 0: { patterns: [ { match: '\\t', name: 'punctuation.whitespace.leading.tab.hard-tab' } ] } }, match: '^\\t+' }, { captures: { 0: { patterns: [ { match: '\\t', name: 'punctuation.whitespace.trailing.tab.hard-tab' } ] } }, match: '\\t+$' }, {match: '\\t', name: 'punctuation.whitespace.tab.hard-tab'} ] }, url: { patterns: [ { captures: { 1: {name: 'punctuation.definition.link.begin.url'}, 2: {name: 'constant.other.reference.link.underline.$3.url'}, 4: {name: 'punctuation.definition.link.end.url'} }, match: "(?x)\n(\"|'|\\b)\n(\n\t# Not part of official URL schemes, included here for convenience\n\t(?: (?:jdbc|mvn|odbc|view-source) :)?\n\n\t# Common protocols/URI schemes\n\t( https?\n\t| s?ftp\n\t| ftps\n\t| file\n\t| wss?\n\t| (?:git|svn) (?:\\+(?:https?|ssh))?\n\t| ssh\n\t\n\t# Less common URI schemes\n\t| aaas?\n\t| acap\n\t| adiumxtra\n\t| admin\n\t| afp\n\t| app\n\t| atom\n\t| aurora\n\t| aw\n\t| beshare\n\t| bolo\n\t| cassandra\n\t| chrome(?:-extension)?\n\t| coaps?\n\t| cockroach\n\t| content\n\t| couchbase\n\t| crid\n\t| cvs\n\t| dict\n\t| dns\n\t| docker\n\t| ed2k\n\t| facetime\n\t| feed\n\t| finger\n\t| fish\n\t| gemini\n\t| github(?:-(?:mac|linux|windows))?\n\t| gizmoproject\n\t| gopher\n\t| go\n\t| hcp\n\t| imap\n\t| irc[6s]?\n\t| issue\n\t| keyparc\n\t| lastfm\n\t| ldaps?\n\t| man(?:-?page)?\n\t| maria(?:db)?\n\t| market\n\t| message\n\t| mms\n\t| modern-?sqlite\n\t| mongodb\n\t| ms-help\n\t| mssql\n\t| mumble\n\t| my?sql\n\t| netezza\n\t| nfs\n\t| ni\n\t| nntp\n\t| notes\n\t| oleodbc\n\t| oracle\n\t| payto\n\t| pgsql\n\t| pg\n\t| pop\n\t| postgres(?:ql)?\n\t| postgresql\n\t| presto(?:dbs?|s)\n\t| reload\n\t| resource\n\t| res\n\t| rmi\n\t| rsync\n\t| rtmf?p\n\t| rtmp\n\t| s3\n\t| saphana\n\t| secondlife\n\t| sgn\n\t| shttp\n\t| slack\n\t| smb\n\t| snmp\n\t| soldat\n\t| sqlite3?\n\t| sqlserver\n\t| steam\n\t| stratum\\+[a-z]+\n\t| stuns?\n\t| teamspeak\n\t| telnet\n\t| turns?\n\t| txmt\n\t| udp\n\t| unreal\n\t| ut2004\n\t| ventrilo\n\t| vnc\n\t| wais\n\t| web\\+[a-z]+\n\t| webcal\n\t| wtai\n\t| wyciwyg\n\t| xmpp\n\t| xri\n\t| z39\\.50[rs]\n\t| zoommtg\n\t\n\t# User-defined/arbitrary URI scheme starting with `x-`\n\t| x(?:-[a-z][a-z0-9]*)++\n\t) ://\n\t\n\t# Path specifier\n\t(?:\n\t\t(?! \\#\\w*\\#)\n\t\t(?: [-:\\@\\w.,~%+_/?=&\\#;|!])\n\t)+\n\t\n\t# Don't include trailing punctuation\n\t(?