MCPcopy Create free account
hub / github.com/TruthHun/BookStack / startString

Function startString

static/editor.md/lib/codemirror/mode/groovy/groovy.js:79–103  ·  view source on GitHub ↗
(quote, stream, state)

Source from the content-addressed store, hash-verified

77 tokenBase.isBase = true;
78
79 function startString(quote, stream, state) {
80 var tripleQuoted = false;
81 if (quote != "/" && stream.eat(quote)) {
82 if (stream.eat(quote)) tripleQuoted = true;
83 else return "string";
84 }
85 function t(stream, state) {
86 var escaped = false, next, end = !tripleQuoted;
87 while ((next = stream.next()) != null) {
88 if (next == quote && !escaped) {
89 if (!tripleQuoted) { break; }
90 if (stream.match(quote + quote)) { end = true; break; }
91 }
92 if (quote == '"' && next == "$" && !escaped && stream.eat("{")) {
93 state.tokenize.push(tokenBaseUntilBrace());
94 return "string";
95 }
96 escaped = !escaped && next == "\\";
97 }
98 if (end) state.tokenize.pop();
99 return "string";
100 }
101 state.tokenize.push(t);
102 return t(stream, state);
103 }
104
105 function tokenBaseUntilBrace() {
106 var depth = 1;

Callers 1

tokenBaseFunction · 0.70

Calls 1

tFunction · 0.70

Tested by

no test coverage detected