MCPcopy Create free account
hub / github.com/nwutils/nw-sample-apps / tokenVariable

Function tokenVariable

mini-code-edit/cm/mode/xquery/xquery.js:292–306  ·  view source on GitHub ↗
(stream, state)

Source from the content-addressed store, hash-verified

290
291 // tokenizer for variables
292 function tokenVariable(stream, state) {
293 var isVariableChar = /[\w\$_-]/;
294
295 // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote
296 if(stream.eat("\"")) {
297 while(stream.next() !== '\"'){};
298 stream.eat(":");
299 } else {
300 stream.eatWhile(isVariableChar);
301 if(!stream.match(":=", false)) stream.eat(":");
302 }
303 stream.eatWhile(isVariableChar);
304 state.tokenize = tokenBase;
305 return ret("variable", "variable");
306 }
307
308 // tokenizer for XML tags
309 function tokenTag(name, isclose) {

Callers

nothing calls this directly

Calls 1

retFunction · 0.70

Tested by

no test coverage detected