| 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) { |