// 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: ['.qnt'], names: ['quint'], patterns: [ {include: '#hashbangLine'}, {include: '#docComments'}, {include: '#lineComments'}, {include: '#blockComments'}, {include: '#keywords'}, {include: '#storage'}, {include: '#constants'}, {include: '#punctuation'}, {include: '#operators'}, {include: '#identifiers'}, {include: '#strings'}, {include: '#numbers'} ], repository: { blockComments: {begin: '/\\*', end: '\\*/', name: 'comment.block.quint'}, constants: { patterns: [ { match: '\\b(false|true|Bool|Int|Nat)\\b', name: 'constant.language.quint' } ] }, docComments: { patterns: [{match: '///.*$', name: 'comment.block.documentation.quint'}] }, hashbangLine: { patterns: [{match: '\\A#!.*$', name: 'comment.line.hashbang.quint'}] }, identifiers: { patterns: [{match: '[a-zA-Z_]([a-zA-Z0-9_])*', name: 'meta.quint'}] }, keywords: { patterns: [ { match: '\\b(module|import|from|export|as|if|else|match|not|or|and|implies|iff|all|any|leadsTo|strongFair|weakFair)\\b', name: 'keyword.control.quint' } ] }, lineComments: { patterns: [{match: '//.*$', name: 'comment.line.double-slash.quint'}] }, numbers: { patterns: [ { match: '-?(0x[0-9a-fA-F]([0-9a-fA-F]|_[0-9a-fA-F])*|0|[1-9]([0-9]|_[0-9])*)', name: 'constant.numeric.quint' } ] }, operators: { patterns: [ { match: "(=>|->|<=|>|<|=|!=|'|\\.|\\*|\\+|-|/|%|\\^)", name: 'keyword.operator.quint' } ] }, punctuation: { patterns: [ {match: '\\.\\.\\.', name: 'keyword.operator.spread.quint'}, {match: '::', name: 'punctuation.accessor.quint'}, {match: '\\|', name: 'punctuation.separator.quint'} ] }, storage: { patterns: [ { match: '\\b(type|assume|const|var|val|nondet|def|pure|action|temporal|run)\\b', name: 'storage.modifier.quint' }, {match: '\\b(Set|List|int|str|bool)\\b', name: 'storage.type.quint'}, {match: '\\b(Map|Tup|Rec)\\b', name: 'support.type.quint'} ] }, strings: {begin: '"', end: '"', name: 'string.quoted.double.quint'} }, scopeName: 'source.quint' } export default grammar