MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / tokenLexer

Function tokenLexer

static/js/codemirror/mode/vb/vb.js:184–217  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

182
183
184 function tokenLexer(stream, state) {
185 var style = state.tokenize(stream, state);
186 var current = stream.current();
187
188 // Handle '.' connected identifiers
189 if (current === '.') {
190 style = state.tokenize(stream, state);
191 current = stream.current();
192 if (style === 'variable') {
193 return 'variable';
194 } else {
195 return ERRORCLASS;
196 }
197 }
198
199
200 var delimiter_index = '[({'.indexOf(current);
201 if (delimiter_index !== -1) {
202 indent(stream, state );
203 }
204 if (indentInfo === 'dedent') {
205 if (dedent(stream, state)) {
206 return ERRORCLASS;
207 }
208 }
209 delimiter_index = '])}'.indexOf(current);
210 if (delimiter_index !== -1) {
211 if (dedent(stream, state)) {
212 return ERRORCLASS;
213 }
214 }
215
216 return style;
217 }
218
219 var external = {
220 electricChars:"dDpPtTfFeE ",

Callers 1

vb.jsFile · 0.70

Calls 2

indentFunction · 0.70
dedentFunction · 0.70

Tested by

no test coverage detected