-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
source.cirru.js
53 lines (51 loc) · 1.44 KB
/
source.cirru.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
// This is a TextMate grammar distributed by `starry-night`.
// This grammar is developed at
// <https://github.com/Cirru/sublime-cirru>
// and licensed `mit`.
// See <https://github.com/wooorm/starry-night> for more info.
/**
* @import {Grammar} from '@wooorm/starry-night'
*/
/** @type {Grammar} */
const grammar = {
extensions: ['.cirru'],
names: ['cirru'],
patterns: [
{
begin: '"',
end: '"',
name: 'string.quoted.double.cirru',
patterns: [{match: '\\\\.', name: 'constant.character.escape.cirru'}]
},
{match: '-?\\b\\d\\S*\\b', name: 'constant.numeric.cirru'},
{match: '(?=^)\\s*\\,', name: 'keyword.operator.cirru'},
{match: '\\s\\$\\s*$', name: 'keyword.operator.cirru'},
{
match: '(?=^)\\s*[^\\(\\)\\s][^\\(\\)\\s]*',
name: 'support.function.cirru'
},
{
match: '(?<=\\()[^\\(\\)\\s][^\\(\\)\\s]*',
name: 'support.function.cirru'
},
{
match: '(?=\\$\\s+)[^\\(\\)\\s][^\\(\\)\\s]*',
name: 'support.function.cirru'
},
{
captures: {
1: {name: 'keyword.operator.cirru'},
3: {name: 'support.function.cirru'}
},
match: '\\s+((\\$\\s+)+)([^\\(\\)\\s][^\\(\\)\\s]*)',
name: 'entity.cirru'
},
{match: '[\\)\\(]', name: 'keyword.operator.cirru'},
{
match: '(?!=($\\s+))[^\\(\\)\\s][^\\(\\)\\s]*',
name: 'variable.parameter.cirru'
}
],
scopeName: 'source.cirru'
}
export default grammar