MCPcopy Create free account
hub / github.com/sql-js/sql.js / hookVar

Function hookVar

GUI/codemirror/mode/sql/sql.js:217–241  ·  view source on GitHub ↗
(stream)

Source from the content-addressed store, hash-verified

215
216 // variable token
217 function hookVar(stream) {
218 // variables
219 // @@prefix.varName @varName
220 // varName can be quoted with ` or ' or "
221 // ref: http://dev.mysql.com/doc/refman/5.5/en/user-variables.html
222 if (stream.eat("@")) {
223 stream.match(/^session\./);
224 stream.match(/^local\./);
225 stream.match(/^global\./);
226 }
227
228 if (stream.eat("'")) {
229 stream.match(/^.*'/);
230 return "variable-2";
231 } else if (stream.eat('"')) {
232 stream.match(/^.*"/);
233 return "variable-2";
234 } else if (stream.eat("`")) {
235 stream.match(/^.*`/);
236 return "variable-2";
237 } else if (stream.match(/^[0-9a-zA-Z$\.\_]+/)) {
238 return "variable-2";
239 }
240 return null;
241 };
242
243 // short client keyword token
244 function hookClient(stream) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…