-
-
Notifications
You must be signed in to change notification settings - Fork 37
Expand file tree
/
Copy pathsource.quint.js
More file actions
99 lines (97 loc) · 2.72 KB
/
Copy pathsource.quint.js
File metadata and controls
99 lines (97 loc) · 2.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/informalsystems/quint-grammars>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> 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