MCPcopy Index your code
hub / github.com/TruthHun/BookStack / tokenString

Function tokenString

static/editor.md/lib/codemirror/mode/shell/shell.js:84–105  ·  view source on GitHub ↗
(quote)

Source from the content-addressed store, hash-verified

82 }
83
84 function tokenString(quote) {
85 return function(stream, state) {
86 var next, end = false, escaped = false;
87 while ((next = stream.next()) != null) {
88 if (next === quote && !escaped) {
89 end = true;
90 break;
91 }
92 if (next === '$' && !escaped && quote !== '\'') {
93 escaped = true;
94 stream.backUp(1);
95 state.tokens.unshift(tokenDollar);
96 break;
97 }
98 escaped = !escaped && next === '\\';
99 }
100 if (end || !escaped) {
101 state.tokens.shift();
102 }
103 return (quote === '`' || quote === ')' ? 'quote' : 'string');
104 };
105 };
106
107 var tokenDollar = function(stream, state) {
108 if (state.tokens.length > 1) stream.eat('$');

Callers 2

tokenBaseFunction · 0.70
tokenDollarFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected