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

Function tokenLexer

static/editor.md/lib/codemirror/mode/vb/vb.js:197–230  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

195
196
197 function tokenLexer(stream, state) {
198 var style = state.tokenize(stream, state);
199 var current = stream.current();
200
201 // Handle '.' connected identifiers
202 if (current === '.') {
203 style = state.tokenize(stream, state);
204 current = stream.current();
205 if (style === 'variable') {
206 return 'variable';
207 } else {
208 return ERRORCLASS;
209 }
210 }
211
212
213 var delimiter_index = '[({'.indexOf(current);
214 if (delimiter_index !== -1) {
215 indent(stream, state );
216 }
217 if (indentInfo === 'dedent') {
218 if (dedent(stream, state)) {
219 return ERRORCLASS;
220 }
221 }
222 delimiter_index = '])}'.indexOf(current);
223 if (delimiter_index !== -1) {
224 if (dedent(stream, state)) {
225 return ERRORCLASS;
226 }
227 }
228
229 return style;
230 }
231
232 var external = {
233 electricChars:"dDpPtTfFeE ",

Callers 1

vb.jsFile · 0.70

Calls 2

indentFunction · 0.70
dedentFunction · 0.70

Tested by

no test coverage detected