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

Function tokenComment

static/editor.md/lib/codemirror/mode/rust/rust.js:118–139  ·  view source on GitHub ↗
(depth)

Source from the content-addressed store, hash-verified

116 }
117
118 function tokenComment(depth) {
119 return function(stream, state) {
120 var lastCh = null, ch;
121 while (ch = stream.next()) {
122 if (ch == "/" && lastCh == "*") {
123 if (depth == 1) {
124 state.tokenize = tokenBase;
125 break;
126 } else {
127 state.tokenize = tokenComment(depth - 1);
128 return state.tokenize(stream, state);
129 }
130 }
131 if (ch == "*" && lastCh == "/") {
132 state.tokenize = tokenComment(depth + 1);
133 return state.tokenize(stream, state);
134 }
135 lastCh = ch;
136 }
137 return "comment";
138 };
139 }
140
141 // Parser
142

Callers 1

tokenBaseFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected