// 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: ['.pq'], names: ['power-query', 'powerquery'], patterns: [ {include: '#Noise'}, {include: '#LiteralExpression'}, {include: '#Keywords'}, {include: '#ImplicitVariable'}, {include: '#IntrinsicVariable'}, {include: '#Operators'}, {include: '#DotOperators'}, {include: '#TypeName'}, {include: '#RecordExpression'}, {include: '#Punctuation'}, {include: '#QuotedIdentifier'}, {include: '#Identifier'} ], repository: { BlockComment: { begin: '/\\*', end: '\\*/', name: 'comment.block.powerquery' }, DecimalNumber: { match: '(?)|(=)|(<>|<|>|<=|>=)|(&)|(\\+|-|\\*|\\/)|(!)|(\\?)' }, Punctuation: { captures: { 1: {name: 'punctuation.separator.powerquery'}, 2: {name: 'punctuation.section.parens.begin.powerquery'}, 3: {name: 'punctuation.section.parens.end.powerquery'}, 4: {name: 'punctuation.section.braces.begin.powerquery'}, 5: {name: 'punctuation.section.braces.end.powerquery'} }, match: '(,)|(\\()|(\\))|({)|(})' }, QuotedIdentifier: { begin: '#"', beginCaptures: { 0: {name: 'punctuation.definition.quotedidentifier.begin.powerquery'} }, end: '"(?!")', endCaptures: { 0: {name: 'punctuation.definition.quotedidentifier.end.powerquery'} }, name: 'entity.name.powerquery', patterns: [ {match: '""', name: 'constant.character.escape.quote.powerquery'}, {include: '#EscapeSequence'} ] }, RecordExpression: { begin: '\\[', beginCaptures: { 0: {name: 'punctuation.section.brackets.begin.powerquery'} }, contentName: 'meta.recordexpression.powerquery', end: '\\]', endCaptures: {0: {name: 'punctuation.section.brackets.end.powerquery'}}, patterns: [{include: '$self'}] }, String: { begin: '"', beginCaptures: { 0: {name: 'punctuation.definition.string.begin.powerquery'} }, end: '"(?!")', endCaptures: {0: {name: 'punctuation.definition.string.end.powerquery'}}, name: 'string.quoted.double.powerquery', patterns: [ {match: '""', name: 'constant.character.escape.quote.powerquery'}, {include: '#EscapeSequence'} ] }, TypeName: { captures: { 1: {name: 'storage.modifier.powerquery'}, 2: {name: 'storage.type.powerquery'} }, match: '\\b(?:(optional|nullable)|(action|any|anynonnull|binary|date|datetime|datetimezone|duration|function|list|logical|none|null|number|record|table|text|type))\\b' }, Whitespace: {match: '\\s+'} }, scopeName: 'source.powerquery' } export default grammar