MCPcopy Index your code
hub / github.com/feiyu563/PrometheusAlert / tokenBase

Function tokenBase

static/plugins/codemirror/mode/python/python.js:78–99  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

76
77 // tokenizers
78 function tokenBase(stream, state) {
79 var sol = stream.sol() && state.lastToken != "\\"
80 if (sol) state.indent = stream.indentation()
81 // Handle scope changes
82 if (sol && top(state).type == "py") {
83 var scopeOffset = top(state).offset;
84 if (stream.eatSpace()) {
85 var lineOffset = stream.indentation();
86 if (lineOffset > scopeOffset)
87 pushPyScope(state);
88 else if (lineOffset < scopeOffset && dedent(stream, state) && stream.peek() != "#")
89 state.errorToken = true;
90 return null;
91 } else {
92 var style = tokenBaseInner(stream, state);
93 if (scopeOffset > 0 && dedent(stream, state))
94 style += " " + ERRORCLASS;
95 return style;
96 }
97 }
98 return tokenBaseInner(stream, state);
99 }
100
101 function tokenBaseInner(stream, state, inFormat) {
102 if (stream.eatSpace()) return null;

Callers

nothing calls this directly

Calls 4

topFunction · 0.85
pushPyScopeFunction · 0.85
tokenBaseInnerFunction · 0.85
dedentFunction · 0.70

Tested by

no test coverage detected