-
-
Notifications
You must be signed in to change notification settings - Fork 31
/
source.hoon.js
55 lines (53 loc) · 1.7 KB
/
source.hoon.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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/pkova/hoon-grammar>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.hoon'],
names: ['hoon'],
patterns: [
{begin: '::', end: '\\n', name: 'comment.line.hoon'},
{begin: '\\s*"""', end: '\\s*"""', name: 'string.double.hoon'},
{begin: "\\s*'''", end: "\\s*'''", name: 'string.double.hoon'},
{
begin: '\\"',
end: '\\"',
name: 'string.double.hoon',
patterns: [{match: '\\\\.|[^"]'}]
},
{
begin: "\\'",
end: "\\'",
name: 'string.single.hoon',
patterns: [{match: "\\\\.|[^']"}]
},
{
match: '[a-z]([a-z0-9-]*[a-z0-9])?(?=\\=)',
name: 'constant.character.hoon'
},
{
begin: '\\+[-+] (?=[a-z]([a-z0-9-]*[a-z0-9])?)',
contentName: 'entity.name.function.hoon',
end: '(?![a-z0-9-])'
},
{match: '%[a-z]([a-z0-9-]*[a-z0-9])?', name: 'constant.character.hoon'},
{match: '@(?:[a-z0-9-]*[a-z0-9])?|\\*', name: 'storage.type.hoon'},
{
match:
'\\.[\\^\\+\\*=\\?]|![><:\\.=\\?!]|=[>|:,\\.\\-\\^<+;/~\\*\\?]|\\?[>|:\\.\\-\\^<\\+&~=@!]|\\|[\\$_%:\\.\\-\\^~\\*=@\\?]|\\+[|\\$\\+\\*]|:[_\\-\\^\\+~\\*]|%[_:\\.\\-\\^\\+~\\*=]|\\^[|:\\.\\-\\+&~\\*=\\?]|\\$[|_%:<>\\-\\^&~@=\\?]|;[:<\\+;\\/~\\*=]|~[>|\\$_%<\\+\\/&=\\?!]|--|==',
name: 'keyword.control.hoon'
},
{
begin: ';script(type "text/coffeescript")',
end: '==',
name: 'keyword.control.hoon'
}
],
scopeName: 'source.hoon'
}
export default grammar