// 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: [], extensionsWithDot: ['.tl'], names: ['teal'], patterns: [{include: '#expression'}, {include: '#statement'}], repository: { attribute: { match: '<\\s*(const|close|total)\\s*>', name: 'storage.modifier.teal' }, base: { patterns: [ {include: '#pragma'}, {include: '#comment'}, {include: '#constant'}, {include: '#number'}, {include: '#string'}, {include: '#long-string'}, {include: '#attribute'} ] }, brackets: { patterns: [ { begin: '\\[', end: '\\]', name: 'teal.brackets', patterns: [{include: '#expression'}] } ] }, break: {match: '\\b(break)\\b', name: 'keyword.control.teal'}, 'builtin-function': { patterns: [ { match: '(?\\s*)?\\(', beginCaptures: { 1: {name: 'keyword.declaration.function.teal'}, 3: {name: 'support.type.teal'} }, end: '\\)', patterns: [ {include: '#comment'}, { match: '[a-zA-Z_][a-zA-Z0-9_]*\\s*(?=:)', name: 'function.argument.teal' }, {include: '#type'} ] }, { captures: { 1: {name: 'keyword.declaration.function.teal'}, 3: {name: 'support.type.teal'} }, match: '(\\bfunction\\b)\\s*(<\\s*)?([a-zA-Z_][a-zA-Z0-9_, ]*\\s*)?(>\\s*)?' } ] }, generics: { patterns: [ { begin: '<', end: '>', name: 'type.arguments.teal', patterns: [{include: '#comment'}, {include: '#type-arg'}] } ] }, goto: {match: '\\b(goto)\\b', name: 'keyword.control.teal'}, 'if-block': { begin: '\\bif\\b', captures: {0: {name: 'keyword.control.teal'}}, end: '\\bend\\b', name: 'statement.if-block.teal', patterns: [ {include: '#expression'}, {match: '\\bthen\\b', name: 'keyword.control.if-then.teal'}, { begin: '\\belseif\\b', captures: {0: {name: 'keyword.control.teal'}}, end: '\\bthen\\b', name: 'statement.elseif.teal', patterns: [{include: '#expression'}] }, {match: '\\belse\\b', name: 'keyword.control.else.teal'}, {include: '#statement'} ] }, label: { match: '::([a-zA-Z_][a-zA-Z0-9_]*)::', name: 'entity.name.label.teal' }, 'long-comment': { patterns: [ { begin: '--\\[(=*)\\[', beginCaptures: { 0: {name: 'punctuation.definition.comment.begin.teal'} }, end: '\\]\\1\\]', endCaptures: {0: {name: 'punctuation.definition.comment.end.teal'}}, name: 'comment.block.teal' } ] }, 'long-string': { begin: '\\[(=*)\\[', beginCaptures: {0: {name: 'punctuation.definition.string.begin.teal'}}, end: '\\]\\1\\]', endCaptures: {0: {name: 'punctuation.definition.string.end.teal'}}, name: 'string.multiline.teal' }, 'new-type-declaration': { begin: '\\b(type)\\b', beginCaptures: {1: {name: 'keyword.declaration.type.teal'}}, end: '$', patterns: [ { begin: '[a-zA-Z_][a-zA-Z0-9_]*', beginCaptures: {0: {name: 'support.type.teal'}}, end: '(=|$)', patterns: [{include: '#comment'}] }, { begin: '(?<==)', end: '$', patterns: [ {include: '#comment'}, {include: '#function-call'}, {include: '#record-or-interface-block'}, {include: '#enum-block'}, {include: '#type'} ] } ] }, number: { patterns: [ { match: '(?=?|(?