1
CodeMirror.defineMode("settings", function() {
3
token: function(stream, state) {
4
var sol = stream.sol() || state.afterSection;
5
var eol = stream.eol();
7
state.afterSection = false;
10
if (state.nextMultiline) {
11
state.inMultiline = true;
12
state.nextMultiline = false;
14
state.position = "def";
18
if (eol && ! state.nextMultiline) {
19
state.inMultiline = false;
20
state.position = "def";
24
while(stream.eatSpace());
27
var ch = stream.next();
29
if (sol && (ch === "#")) {
30
state.position = "comment";
33
} else if (ch === " ") {
34
state.position = "quote";
36
} else if (ch === "\\" && state.position === "quote") {
37
if (stream.next() !== "u") { // u = Unicode sequence \u1234
39
state.nextMultiline = true;
43
return state.position;
46
startState: function() {
48
position : "def", // Current position, "def", "quote" or "comment"
49
nextMultiline : false, // Is the next line multiline value
50
inMultiline : false, // Is the current line a multiline value
51
afterSection : false // Did we just open a section