(stream, state)
| 63 | return style; |
| 64 | } |
| 65 | function tokenBase(stream, state) { |
| 66 | var ch = stream.next(); |
| 67 | if (ch == '"' || ch == "'") { |
| 68 | state.tokenize = tokenString(ch); |
| 69 | return state.tokenize(stream, state); |
| 70 | } else if (ch == "." && stream.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)) { |
| 71 | return ret("number", "number"); |
| 72 | } else if (ch == "." && stream.match("..")) { |
| 73 | return ret("spread", "meta"); |
| 74 | } else if (/[\[\]{}\(\),;\:\.]/.test(ch)) { |
| 75 | return ret(ch); |
| 76 | } else if (ch == "=" && stream.eat(">")) { |
| 77 | return ret("=>", "operator"); |
| 78 | } else if (ch == "0" && stream.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)) { |
| 79 | return ret("number", "number"); |
| 80 | } else if (/\d/.test(ch)) { |
| 81 | stream.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/); |
| 82 | return ret("number", "number"); |
| 83 | } else if (ch == "/") { |
| 84 | if (stream.eat("*")) { |
| 85 | state.tokenize = tokenComment; |
| 86 | return tokenComment(stream, state); |
| 87 | } else if (stream.eat("/")) { |
| 88 | stream.skipToEnd(); |
| 89 | return ret("comment", "comment"); |
| 90 | } else if (expressionAllowed(stream, state, 1)) { |
| 91 | readRegexp(stream); |
| 92 | stream.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/); |
| 93 | return ret("regexp", "string-2"); |
| 94 | } else { |
| 95 | stream.eat("="); |
| 96 | return ret("operator", "operator", stream.current()); |
| 97 | } |
| 98 | } else if (ch == "`") { |
| 99 | state.tokenize = tokenQuasi; |
| 100 | return tokenQuasi(stream, state); |
| 101 | } else if (ch == "#" && stream.peek() == "!") { |
| 102 | stream.skipToEnd(); |
| 103 | return ret("meta", "meta"); |
| 104 | } else if (ch == "#" && stream.eatWhile(wordRE)) { |
| 105 | return ret("variable", "property") |
| 106 | } else if (ch == "<" && stream.match("!--") || |
| 107 | (ch == "-" && stream.match("->") && !/\S/.test(stream.string.slice(0, stream.start)))) { |
| 108 | stream.skipToEnd() |
| 109 | return ret("comment", "comment") |
| 110 | } else if (isOperatorChar.test(ch)) { |
| 111 | if (ch != ">" || !state.lexical || state.lexical.type != ">") { |
| 112 | if (stream.eat("=")) { |
| 113 | if (ch == "!" || ch == "=") stream.eat("=") |
| 114 | } else if (/[<>*+\-|&?]/.test(ch)) { |
| 115 | stream.eat(ch) |
| 116 | if (ch == ">") stream.eat(ch) |
| 117 | } |
| 118 | } |
| 119 | if (ch == "?" && stream.eat(".")) return ret(".") |
| 120 | return ret("operator", "operator", stream.current()); |
| 121 | } else if (wordRE.test(ch)) { |
| 122 | stream.eatWhile(wordRE); |
nothing calls this directly
no test coverage detected