-
-
Notifications
You must be signed in to change notification settings - Fork 33
/
source.java-properties.js
83 lines (81 loc) · 2.47 KB
/
source.java-properties.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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/textmate/java.tmbundle>
// and licensed permissive.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: [],
names: ['java-properties'],
patterns: [
{match: '^\\s*$'},
{include: '#comment-line'},
{include: '#property-name'},
{include: '#property-definition'}
],
repository: {
'comment-line': {
captures: {
1: {name: 'punctuation.whitespace.comment.leading.java-properties'},
2: {name: 'punctuation.definition.comment.java-properties'}
},
match: '^(\\s*)([#!])(.+)?$\\n?',
name: 'comment.line.java-properties'
},
'property-definition': {
begin: '^(\\s*)((?:\\\\[ \\t]|\\\\:|\\\\=|[^:=\\s])+)(?:\\s*([:=]))?\\s*',
beginCaptures: {
1: {name: 'punctuation.whitespace.leading.java-properties'},
2: {
name: 'support.constant.java-properties',
patterns: [
{
match: '\\\\(?:[ \\t:=\\\\ntfr\\"\']|u[0-9A-Fa-f]{4})',
name: 'constant.character.escape.java-properties'
}
]
},
3: {name: 'punctuation.separator.key-value.java-properties'}
},
contentName: 'string.unquoted.java-properties',
end: '(?<!\\\\{1})$\\n',
name: 'meta.key-value.java-properties',
patterns: [
{
match: '^\\s*',
name: 'punctuation.whitespace.leading.java-properties'
},
{
match: '(\\\\{1})(?=$\\n)',
name: 'punctuation.separator.continuation.java-properties'
},
{
match: '\\\\(?:[\\\\ntfr\\"\']|u[0-9A-Fa-f]{4})',
name: 'constant.character.escape.java-properties'
}
]
},
'property-name': {
captures: {
1: {name: 'punctuation.whitespace.comment.leading.java-properties'},
2: {
name: 'support.constant.java-properties',
patterns: [
{
match: '\\\\(?:[ \\t:=\\\\ntfr\\"\']|u[0-9A-Fa-f]{4})',
name: 'constant.character.escape.java-properties'
}
]
}
},
match:
'^(\\s*)((?:\\\\[ \\t]|\\\\:|\\\\=|[^:=\\s])+)(?:\\s*([:=]))?\\s*$\\n',
name: 'meta.key-value.java-properties'
}
},
scopeName: 'source.java-properties'
}
export default grammar