-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
source.nemerle.js
105 lines (103 loc) · 3.27 KB
/
source.nemerle.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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is licensed permissive.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.n'],
names: ['nemerle'],
patterns: [
{
begin: '(^[ \\t]+)?(?=//)',
beginCaptures: {
1: {name: 'punctuation.whitespace.comment.leading.nemerle'}
},
end: '(?!\\G)',
patterns: [
{
begin: '//',
beginCaptures: {0: {name: 'punctuation.definition.comment.nemerle'}},
end: '\\n',
name: 'comment.line.double-slash.nemerle'
}
]
},
{
begin: '/\\*',
captures: {0: {name: 'punctuation.definition.comment.nemerle'}},
end: '\\*/',
name: 'comment.block.nemerle'
},
{match: '\\b(|false|null|true)\\b', name: 'constant.language.nemerle'},
{
match:
'\\b(([0-9]+(\\.|\\_)?[0-9]*(b|bu|d|f|L|LU|m|u|ub|UL)?)|(0(b|o|x)[0-9]+))\\b',
name: 'constant.numeric.nemerle'
},
{
match:
'\\b(catch|else|finally|for|foreach|if|match|repeat|try|unless|when|while)\\b',
name: 'keyword.control.nemerle'
},
{match: '(\\+|\\-|\\*|\\/|\\%)\\=?', name: 'keyword.operator.nemerle'},
{
match:
'\\b(\\_|as|assert|base|checked|do|fun|get|ignore|implements|in|is|lock|namespace|out|params|ref|set|syntax|throw|typeof|unchecked|using|with)\\b',
name: 'keyword.other.nemerle'
},
{
match:
'\\b(array|bool|byte|char|class|decimal|double|enum|float|int|interface|list|long|macro|module|object|sbyte|short|string|struct|type|uint|ulong|ushort|variant|void)\\b',
name: 'storage.type.nemerle'
},
{
match:
'\\b(abstract|def|delegate|event|extern|internal|mutable|override|public|private|protected|sealed|static|volatile|virtual|new)\\b',
name: 'storage.modifier.nemerle'
},
{match: 'this', name: 'variable.language.nemerle'},
{
begin: '"',
beginCaptures: {0: {name: 'punctuation.definition.string.begin.nemerle'}},
end: '"',
endCaptures: {0: {name: 'punctuation.definition.string.end.nemerle'}},
name: 'string.quoted.double.nemerle',
patterns: [
{
match: '\\\\(\\\\|\'|\\"|a|b|c[A-Z]+|e|f|n|r|u0+[0-9,A-Z]+|v)',
name: 'constant.character.escape.nemerle'
}
]
},
{
begin: '\\$"',
beginCaptures: {0: {name: 'punctuation.definition.string.begin.nemerle'}},
end: '"',
endCaptures: {0: {name: 'punctuation.definition.string.end.nemerle'}},
name: 'string.interpolated.nemerle',
patterns: [
{
match: '\\$[a-z,A-Z]+[a-z,A-Z,0-9]*( |\\+|\\-|\\*|\\/|\\%)',
name: 'constant.character.escape'
}
]
},
{
begin: "'",
beginCaptures: {0: {name: 'punctuation.definition.string.begin.nemerle'}},
end: "'",
endCaptures: {0: {name: 'punctuation.definition.string.end.nemerle'}},
name: 'string.quoted.single.nemerle',
patterns: [
{
match: '\\\\(\\\\|\'|\\"|a|b|c[A-Z]+|e|f|n|r|u0+[0-9,A-Z]+|v)',
name: 'constant.character.escape'
}
]
}
],
scopeName: 'source.nemerle'
}
export default grammar