(stream, state)
| 21 | dateSQL = parserConfig.dateSQL || {"date" : true, "time" : true, "timestamp" : true}; |
| 22 | |
| 23 | function tokenBase(stream, state) { |
| 24 | var ch = stream.next(); |
| 25 | |
| 26 | // call hooks from the mime type |
| 27 | if (hooks[ch]) { |
| 28 | var result = hooks[ch](stream, state); |
| 29 | if (result !== false) return result; |
| 30 | } |
| 31 | |
| 32 | if (support.hexNumber == true && |
| 33 | ((ch == "0" && stream.match(/^[xX][0-9a-fA-F]+/)) |
| 34 | || (ch == "x" || ch == "X") && stream.match(/^'[0-9a-fA-F]+'/))) { |
| 35 | // hex |
| 36 | // ref: http://dev.mysql.com/doc/refman/5.5/en/hexadecimal-literals.html |
| 37 | return "number"; |
| 38 | } else if (support.binaryNumber == true && |
| 39 | (((ch == "b" || ch == "B") && stream.match(/^'[01]+'/)) |
| 40 | || (ch == "0" && stream.match(/^b[01]+/)))) { |
| 41 | // bitstring |
| 42 | // ref: http://dev.mysql.com/doc/refman/5.5/en/bit-field-literals.html |
| 43 | return "number"; |
| 44 | } else if (ch.charCodeAt(0) > 47 && ch.charCodeAt(0) < 58) { |
| 45 | // numbers |
| 46 | // ref: http://dev.mysql.com/doc/refman/5.5/en/number-literals.html |
| 47 | stream.match(/^[0-9]*\.?[0-9]+([eE][-+]?[0-9]+)?/); |
| 48 | support.decimallessFloat == true && stream.eat('.'); |
| 49 | return "number"; |
| 50 | } else if (ch == "?" && (stream.eatSpace() || stream.eol() || stream.eat(";"))) { |
| 51 | // placeholders |
| 52 | return "variable-3"; |
| 53 | } else if (ch == "'" || (ch == '"' && support.doubleQuote)) { |
| 54 | // strings |
| 55 | // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html |
| 56 | state.tokenize = tokenLiteral(ch); |
| 57 | return state.tokenize(stream, state); |
| 58 | } else if ((((support.nCharCast == true && (ch == "n" || ch == "N")) |
| 59 | || (support.charsetCast == true && ch == "_" && stream.match(/[a-z][a-z0-9]*/i))) |
| 60 | && (stream.peek() == "'" || stream.peek() == '"'))) { |
| 61 | // charset casting: _utf8'str', N'str', n'str' |
| 62 | // ref: http://dev.mysql.com/doc/refman/5.5/en/string-literals.html |
| 63 | return "keyword"; |
| 64 | } else if (/^[\(\),\;\[\]]/.test(ch)) { |
| 65 | // no highlightning |
| 66 | return null; |
| 67 | } else if (support.commentSlashSlash && ch == "/" && stream.eat("/")) { |
| 68 | // 1-line comment |
| 69 | stream.skipToEnd(); |
| 70 | return "comment"; |
| 71 | } else if ((support.commentHash && ch == "#") |
| 72 | || (ch == "-" && stream.eat("-") && (!support.commentSpaceRequired || stream.eat(" ")))) { |
| 73 | // 1-line comments |
| 74 | // ref: https://kb.askmonty.org/en/comment-syntax/ |
| 75 | stream.skipToEnd(); |
| 76 | return "comment"; |
| 77 | } else if (ch == "/" && stream.eat("*")) { |
| 78 | // multi-line comments |
| 79 | // ref: https://kb.askmonty.org/en/comment-syntax/ |
| 80 | state.tokenize = tokenComment; |
nothing calls this directly
no test coverage detected
searching dependent graphs…