-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
source.golo.js
127 lines (125 loc) · 4.24 KB
/
source.golo.js
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/TypeUnsafe/sublime-golo>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.golo'],
names: ['golo'],
patterns: [
{match: '(#).*$\n?', name: 'comment.line.number-sign.golo'},
{
begin: '----',
captures: {0: {name: 'punctuation.definition.comment.golo'}},
end: '----',
name: 'comment.block.golo'
},
{
begin: '/\\*',
captures: {0: {name: 'punctuation.definition.comment.golo'}},
end: '\\*/',
name: 'comment.block.golo'
},
{
begin: '"""',
beginCaptures: {0: {name: 'punctuation.definition.string.begin.golo'}},
end: '"""',
endCaptures: {0: {name: 'punctuation.definition.string.end.golo'}},
name: 'string.quoted.third.golo',
patterns: [
{
match: '(\\$\\w+|\\$\\{[^\\}]+\\})',
name: 'variable.parameter.template.golo'
},
{match: '\\\\.', name: 'constant.character.escape.golo'}
]
},
{
begin: '"',
beginCaptures: {0: {name: 'punctuation.definition.string.begin.golo'}},
end: '"',
endCaptures: {0: {name: 'punctuation.definition.string.end.golo'}},
name: 'string.quoted.double.golo',
patterns: [
{
match: '(\\$\\w+|\\$\\{[^\\}]+\\})',
name: 'variable.parameter.template.golo'
},
{match: '\\\\.', name: 'constant.character.escape.golo'}
]
},
{
begin: "'",
beginCaptures: {0: {name: 'punctuation.definition.string.begin.golo'}},
end: "'",
endCaptures: {0: {name: 'punctuation.definition.string.end.golo'}},
name: 'string.quoted.single.golo',
patterns: [{match: '\\\\.', name: 'constant.character.escape.golo'}]
},
{match: '\\b(true|false|null|super|)\\b', name: 'constant.language.golo'},
{
match:
'\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\\b',
name: 'constant.numeric.golo'
},
{match: '\\b([A-Z][A-Z0-9_]+)\\b', name: 'constant.other.golo'},
{
match: '\\b(this|checkResult|checkArguments|withContext)\\b',
name: 'constant.other.golo'
},
{
match:
'\\b(var|let|val|local|extends|implements|overrides|interfaces)\\b',
name: 'storage.modifier.golo'
},
{
match: '\\b(try|catch|finally|throw|raise)\\b',
name: 'keyword.control.catch-exception.golo'
},
{
match:
'\\b(if|then|else|match|while|for|foreach|do|return|when|otherwise|where|break|continue)\\b',
name: 'keyword.control.golo'
},
{
match:
'\\b(println|print|readln|readpwd|function|fun|pimp|spawn|send|shutdown|augment|AdapterFabric|DynamicObject|Thread|Promise|promise|Observable|DynamicVariable|defaultContext|module|import|fileToText|textToFile|mapEntry|compile|TemplateEngine|EvaluationEnvironment|asInterfaceInstance|)\\b',
name: 'keyword.other.golo'
},
{
match:
'\\b(define|fail|onSet|onFail|onChange|invokeWithArguments|stringify|value|get|set|future|times|each|filter|map)\\b',
name: 'support.function.js'
},
{
match:
'\\b(in|not|and|or|is|isnt|as|andThen|bindTo|bindAt|\\?:|orIfNull|oftype)\\b',
name: 'keyword.operator.golo'
},
{
match: '(==|!=|<=|>=|<>|<|>|\\?:)',
name: 'keyword.operator.comparison.golo'
},
{match: '(=)', name: 'keyword.operator.assignment.golo'},
{match: '(:|\\||)', name: 'keyword.operator.declaration.golo'},
{match: '(\\.)', name: 'keyword.operator.dot.golo'},
{
match: '(\\-\\-|\\+\\+)',
name: 'keyword.operator.increment-decrement.golo'
},
{match: '(\\-|\\+|\\*|\\/|%)', name: 'keyword.operator.arithmetic.golo'},
{match: '(!|&&|\\|\\|)', name: 'keyword.operator.logical.golo'},
{
match:
'\\b(struct|range\\[|tuple\\[|array\\[|map\\[|set\\[|vector\\[|list\\[)|\\[|\\]|\\b',
name: 'support.class.golo'
},
{match: '(\\{|\\}|@|\\(|\\))', name: 'support.class.golo'}
],
scopeName: 'source.golo'
}
export default grammar