modeler/angular/app/scripts/lib/codemirror/mode/xquery/xquery.js
function tokenVariable(stream, state) {
    var isVariableChar = /[\w\$_-]/;

    // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote
    if(stream.eat("\"")) {
      while(stream.next() !== '\"'){};
      stream.eat(":");
    } else {
      stream.eatWhile(isVariableChar);
      if(!stream.match(":=", false)) stream.eat(":");
    }
    stream.eatWhile(isVariableChar);
    state.tokenize = tokenBase;
    return ret("variable", "variable");
  }
function tokenVariable(stream, state) {
    var isVariableChar = /[\w\$_-]/;

    // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote
    if(stream.eat("\"")) {
      while(stream.next() !== '\"'){};
      stream.eat(":");
    } else {
      stream.eatWhile(isVariableChar);
      if(!stream.match(":=", false)) stream.eat(":");
    }
    stream.eatWhile(isVariableChar);
    state.tokenize = tokenBase;
    return ret("variable", "variable");
  }
function tokenVariable ( stream , state ) { var isVariableChar = / [\w\$_-] / ; // a variable may start with a quoted EQName so if the next character is quote, consume to the next quote if ( stream . eat ( "\"" ) ) { while ( stream . next ( ) !== '\"' ) { } ; stream . eat ( ":" ) ; } else { stream . eatWhile ( isVariableChar ) ; if ( ! stream . match ( ":=" , false ) ) stream . eat ( ":" ) ; } stream . eatWhile ( isVariableChar ) ; state . tokenize = tokenBase ; return ret ( "variable" , "variable" ) ; }
tokenizer for variables
tokenizer for variables