MCPcopy Index your code
hub / github.com/pandao/editor.md / tokenBase

Function tokenBase

lib/codemirror/mode/python/python.js:87–106  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

85
86 // tokenizers
87 function tokenBase(stream, state) {
88 // Handle scope changes
89 if (stream.sol() && top(state).type == "py") {
90 var scopeOffset = top(state).offset;
91 if (stream.eatSpace()) {
92 var lineOffset = stream.indentation();
93 if (lineOffset > scopeOffset)
94 pushScope(stream, state, "py");
95 else if (lineOffset < scopeOffset && dedent(stream, state))
96 state.errorToken = true;
97 return null;
98 } else {
99 var style = tokenBaseInner(stream, state);
100 if (scopeOffset > 0 && dedent(stream, state))
101 style += " " + ERRORCLASS;
102 return style;
103 }
104 }
105 return tokenBaseInner(stream, state);
106 }
107
108 function tokenBaseInner(stream, state) {
109 if (stream.eatSpace()) return null;

Callers

nothing calls this directly

Calls 4

topFunction · 0.85
pushScopeFunction · 0.85
tokenBaseInnerFunction · 0.85
dedentFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…