-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.js
58 lines (53 loc) · 1.4 KB
/
main.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
define(function(require, exports, module) {
var LanguageManager = brackets.getModule("language/LanguageManager");
CodeMirror.defineMode("cirru", function() {
return {
startState: function() {
return {
head: true
};
},
token: function(stream, state) {
if (stream.sol()) {
state.head = true;
}
if (stream.match("$")) {
state.head = true;
return "comment";
} else if (stream.match(',')) {
state.head = false;
return 'bracket';
} else if (stream.match(/^[^\$\"\s\(\)][^\"\s\(\)]*/)) {
if (state.head) {
state.head = false;
return "keyword";
} else {
return "atom";
}
} else if (stream.match(/^"([^\\\"]|(\\.))*\"/)) {
if (state.head) {
state.head = false;
return "keyword";
} else {
return "atom";
}
} else if (stream.match("(")) {
state.head = true;
return "comment";
} else if (stream.match(")")) {
state.head = false;
return "comment";
} else {
stream.next();
return null;
}
}
};
});
LanguageManager.defineLanguage("jade", {
name: "Cirru",
mode: "cirru",
fileExtensions: ["cirru", "cr"],
lineComment: ["--"]
});
});