MCPcopy Create free account
hub / github.com/feiyu563/PrometheusAlert / normal

Function normal

static/plugins/codemirror/mode/lua/lua.js:77–98  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

75 }
76
77 function normal(stream, state) {
78 var ch = stream.next();
79 if (ch == "-" && stream.eat("-")) {
80 if (stream.eat("[") && stream.eat("["))
81 return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state);
82 stream.skipToEnd();
83 return "comment";
84 }
85 if (ch == "\"" || ch == "'")
86 return (state.cur = string(ch))(stream, state);
87 if (ch == "[" && /[\[=]/.test(stream.peek()))
88 return (state.cur = bracketed(readBracket(stream), "string"))(stream, state);
89 if (/\d/.test(ch)) {
90 stream.eatWhile(/[\w.%]/);
91 return "number";
92 }
93 if (/[\w_]/.test(ch)) {
94 stream.eatWhile(/[\w\\\-_.]/);
95 return "variable";
96 }
97 return null;
98 }
99
100 function bracketed(level, style) {
101 return function(stream, state) {

Callers

nothing calls this directly

Calls 3

bracketedFunction · 0.85
readBracketFunction · 0.85
stringFunction · 0.85

Tested by

no test coverage detected