// 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.lisp'], extensions: ['.ly', '.ily'], names: ['lilypond'], patterns: [{include: '#comments'}, {include: '#expression_component'}], repository: { chord_expression: { patterns: [ { begin: '{', end: '}', name: 'meta.chord-expression.lilypond', patterns: [ {include: '#chord_mode_notation'}, {include: '#octave_transpose_operators'}, { match: ':', name: 'keyword.operator.chord.modifier-indicator.lilypond' }, { match: '\\b(?:aug|dim|m(?:aj)?|sus)', name: 'keyword.other.chord.modifier.lilypond' }, { match: '-', name: 'keyword.operator.chord.alter-note.flat.lilypond' }, { match: '\\+', name: 'keyword.operator.chord.alter-note.sharp.lilypond' }, {match: '\\^', name: 'keyword.operator.chord.remove-note.lilypond'}, { match: '/\\+', name: 'keyword.operator.chord.add-bass-note.lilypond' }, {include: '#chord_expression'}, {include: '$self'} ] } ] }, comments: { patterns: [ { begin: '%{', beginCaptures: { 0: {name: 'punctuation.definition.comment.begin.lilypond'} }, end: '%}', endCaptures: { 0: {name: 'punctuation.definition.comment.end.lilypond'} }, name: 'comment.block.lilypond' }, { begin: '%', beginCaptures: {0: {name: 'punctuation.definition.comment.lilypond'}}, end: '$', name: 'comment.line.lilypond' } ] }, expression_component: { patterns: [ { begin: '{', end: '}', name: 'meta.expression-block.lilypond', patterns: [{include: '#comments'}, {include: '#expression_component'}] }, {include: '#integer'}, { begin: '"', beginCaptures: { 0: {name: 'punctuation.definition.string.begin.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.simultaneous-expressions.begin.lilypond'} }, end: '>>', endCaptures: { 0: {name: 'punctuation.simultaneous-expressions.end.lilypond'} }, name: 'meta.simultaneous-expressions.lilypond', patterns: [{include: '#comments'}, {include: '#expression_component'}] }, { match: '\\\\\\\\', name: 'meta.separator.simultaneous-expressions.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: '#comments'}, {include: '#expression_component'} ] }, { match: '(?', 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: '(?<=[\\w)}])|$', name: 'meta.scheme.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'} ] } ] } ] }, figure_expression: { patterns: [ { begin: '{', end: '}', name: 'meta.figure-expression.lilypond', patterns: [ { begin: '<', beginCaptures: { 0: {name: 'punctuation.definition.figure-group.begin.lilypond'} }, end: '>', endCaptures: { 0: {name: 'punctuation.definition.figure-group.end.lilypond'} }, name: 'meta.figure-group.lilypond', patterns: [ {include: '#figure_expression_contents'}, { begin: '\\[', beginCaptures: { 0: { name: 'punctuation.definition.figure-bracket.begin.lilypond' } }, end: '\\]', endCaptures: { 0: { name: 'punctuation.definition.figure-bracket.end.lilypond' } }, name: 'meta.figure-bracket.lilypond', patterns: [ {match: '[>\\[]', name: 'invalid.illegal.lilypond'}, {include: '#figure_expression_contents'} ] } ] }, {include: '#figure_expression'}, {include: '$self'} ] } ] }, figure_expression_contents: { patterns: [ {match: '<', name: 'invalid.illegal.lilypond'}, {include: '#integer'}, {include: '#comments'}, { match: '\\+', name: 'keyword.operator.figure.accidental.sharp.lilypond' }, {match: '-', name: 'keyword.operator.figure.accidental.flat.lilypond'}, { match: '!', name: 'keyword.operator.figure.accidental.natural.lilypond' }, {match: '_', name: 'support.variable.figure.hidden-third.lilypond'}, {match: '\\\\\\+', name: 'keyword.operator.figure.augmented.lilypond'}, {match: '/', name: 'keyword.operator.figure.diminished.lilypond'}, { match: '\\\\\\\\', name: 'keyword.operator.figure.raised-sixth.lilypond' }, { match: '\\\\!', name: 'keyword.operator.figure.end-continuation-line.lilypond' } ] }, integer: { patterns: [{match: '\\d+', name: 'constant.numeric.integer.lilypond'}] }, paper_expression: { patterns: [ { begin: '{', end: '}', name: 'meta.paper-expression.lilypond', patterns: [ { match: '\\\\(?:[cm]m|in|pt)(?!-?[[:alpha:]])', name: 'support.constant.lilypond' }, {include: '#paper_expression'}, {include: '$self'} ] } ] }, scheme_embedded_lilypond: { patterns: [ { begin: '#\\{', beginCaptures: { 0: {name: 'punctuation.definition.embedded-lilypond.begin.lilypond'} }, end: '#}', endCaptures: { 0: {name: 'punctuation.definition.embedded-lilypond.end.lilypond'} }, name: 'meta.embedded-lilypond.lilypond', patterns: [{include: 'source.lilypond'}] } ] }, scheme_expression: { patterns: [ { begin: '\\(', end: '\\)', name: 'meta.scheme-expression.lilypond', patterns: [ {name: 'support.function.lilypond-scheme'}, {include: '#scheme_embedded_lilypond'}, {include: '#scheme_expression'}, {include: 'source.lisp'} ] } ] } }, scopeName: 'source.lilypond' } export default grammar