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

Function tokenBase

static/editor.md/lib/codemirror/mode/eiffel/eiffel.js:94–119  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

92 }
93
94 function tokenBase(stream, state) {
95 curPunc = null;
96 if (stream.eatSpace()) return null;
97 var ch = stream.next();
98 if (ch == '"'||ch == "'") {
99 return chain(readQuoted(ch, "string"), stream, state);
100 } else if (ch == "-"&&stream.eat("-")) {
101 stream.skipToEnd();
102 return "comment";
103 } else if (ch == ":"&&stream.eat("=")) {
104 return "operator";
105 } else if (/[0-9]/.test(ch)) {
106 stream.eatWhile(/[xXbBCc0-9\.]/);
107 stream.eat(/[\?\!]/);
108 return "ident";
109 } else if (/[a-zA-Z_0-9]/.test(ch)) {
110 stream.eatWhile(/[a-zA-Z_0-9]/);
111 stream.eat(/[\?\!]/);
112 return "ident";
113 } else if (/[=+\-\/*^%<>~]/.test(ch)) {
114 stream.eatWhile(/[=+\-\/*^%<>~]/);
115 return "operator";
116 } else {
117 return null;
118 }
119 }
120
121 function readQuoted(quote, style, unescaped) {
122 return function(stream, state) {

Callers

nothing calls this directly

Calls 2

chainFunction · 0.70
readQuotedFunction · 0.70

Tested by

no test coverage detected