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

Function tokenString

static/editor.md/lib/codemirror/mode/puppet/puppet.js:47–65  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

45 // If a variable is encountered along the way, we display it differently when it
46 // is encapsulated in a double-quoted string.
47 function tokenString(stream, state) {
48 var current, prev, found_var = false;
49 while (!stream.eol() && (current = stream.next()) != state.pending) {
50 if (current === '$' && prev != '\\' && state.pending == '"') {
51 found_var = true;
52 break;
53 }
54 prev = current;
55 }
56 if (found_var) {
57 stream.backUp(1);
58 }
59 if (current == state.pending) {
60 state.continueString = false;
61 } else {
62 state.continueString = true;
63 }
64 return "string";
65 }
66
67 // Main function
68 function tokenize(stream, state) {

Callers 1

tokenizeFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected