| Index: third_party/WebKit/Source/devtools/front_end/cm_web_modes/javascript.js
|
| diff --git a/third_party/WebKit/Source/devtools/front_end/cm_web_modes/javascript.js b/third_party/WebKit/Source/devtools/front_end/cm_web_modes/javascript.js
|
| index 3f614cc2c5f1617d993409a81dbd02bd46a18d60..a717745897415d1cc465d8c9382dce0a620a00b2 100644
|
| --- a/third_party/WebKit/Source/devtools/front_end/cm_web_modes/javascript.js
|
| +++ b/third_party/WebKit/Source/devtools/front_end/cm_web_modes/javascript.js
|
| @@ -12,7 +12,7 @@
|
| "use strict";
|
|
|
| function expressionAllowed(stream, state, backUp) {
|
| - return /^(?:operator|sof|keyword c|case|new|export|default|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
|
| + return /^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(state.lastType) ||
|
| (state.lastType == "quasi" && /\{\s*$/.test(stream.string.slice(0, stream.pos - (backUp || 0))))
|
| }
|
|
|
| @@ -146,8 +146,7 @@
|
| stream.skipToEnd();
|
| return ret("error", "error");
|
| } else if (isOperatorChar.test(ch)) {
|
| - if (ch != ">" || !state.lexical || state.lexical.type != ">")
|
| - stream.eatWhile(isOperatorChar);
|
| + stream.eatWhile(isOperatorChar);
|
| return ret("operator", "operator", stream.current());
|
| } else if (wordRE.test(ch)) {
|
| stream.eatWhile(wordRE);
|
| @@ -505,9 +504,9 @@
|
| if (type == ":") return cont(expressionNoComma);
|
| if (type == "(") return pass(functiondef);
|
| }
|
| - function commasep(what, end, sep) {
|
| + function commasep(what, end) {
|
| function proceed(type, value) {
|
| - if (sep ? sep.indexOf(type) > -1 : type == ",") {
|
| + if (type == ",") {
|
| var lex = cx.state.lexical;
|
| if (lex.info == "call") lex.pos = (lex.pos || 0) + 1;
|
| return cont(function(type, value) {
|
| @@ -540,19 +539,16 @@
|
| }
|
| function typeexpr(type) {
|
| if (type == "variable") {cx.marked = "variable-3"; return cont(afterType);}
|
| - if (type == "string" || type == "number" || type == "atom") return cont(afterType);
|
| - if (type == "{") return cont(pushlex("}"), commasep(typeprop, "}", ",;"), poplex)
|
| + if (type == "{") return cont(commasep(typeprop, "}"))
|
| if (type == "(") return cont(commasep(typearg, ")"), maybeReturnType)
|
| }
|
| function maybeReturnType(type) {
|
| if (type == "=>") return cont(typeexpr)
|
| }
|
| - function typeprop(type, value) {
|
| + function typeprop(type) {
|
| if (type == "variable" || cx.style == "keyword") {
|
| cx.marked = "property"
|
| return cont(typeprop)
|
| - } else if (value == "?") {
|
| - return cont(typeprop)
|
| } else if (type == ":") {
|
| return cont(typeexpr)
|
| }
|
| @@ -562,8 +558,7 @@
|
| else if (type == ":") return cont(typeexpr)
|
| }
|
| function afterType(type, value) {
|
| - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, afterType)
|
| - if (value == "|" || type == ".") return cont(typeexpr)
|
| + if (value == "<") return cont(commasep(typeexpr, ">"), afterType)
|
| if (type == "[") return cont(expect("]"), afterType)
|
| }
|
| function vardef() {
|
| @@ -634,14 +629,12 @@
|
| if (type == "variable") {register(value); return cont(classNameAfter);}
|
| }
|
| function classNameAfter(type, value) {
|
| - if (value == "<") return cont(pushlex(">"), commasep(typeexpr, ">"), poplex, classNameAfter)
|
| - if (value == "extends" || value == "implements" || (isTS && type == ","))
|
| - return cont(isTS ? typeexpr : expression, classNameAfter);
|
| + if (value == "extends" || value == "implements") return cont(isTS ? typeexpr : expression, classNameAfter);
|
| if (type == "{") return cont(pushlex("}"), classBody, poplex);
|
| }
|
| function classBody(type, value) {
|
| if (type == "variable" || cx.style == "keyword") {
|
| - if ((value == "async" || value == "static" || value == "get" || value == "set" ||
|
| + if ((value == "static" || value == "get" || value == "set" ||
|
| (isTS && (value == "public" || value == "private" || value == "protected" || value == "readonly" || value == "abstract"))) &&
|
| cx.stream.match(/^\s+[\w$\xa1-\uffff]/, false)) {
|
| cx.marked = "keyword";
|
| @@ -650,8 +643,6 @@
|
| cx.marked = "property";
|
| return cont(isTS ? classfield : functiondef, classBody);
|
| }
|
| - if (type == "[")
|
| - return cont(expression, expect("]"), isTS ? classfield : functiondef, classBody)
|
| if (value == "*") {
|
| cx.marked = "keyword";
|
| return cont(classBody);
|
| @@ -662,31 +653,22 @@
|
| function classfield(type, value) {
|
| if (value == "?") return cont(classfield)
|
| if (type == ":") return cont(typeexpr, maybeAssign)
|
| - if (value == "=") return cont(expressionNoComma)
|
| return pass(functiondef)
|
| }
|
| - function afterExport(type, value) {
|
| + function afterExport(_type, value) {
|
| if (value == "*") { cx.marked = "keyword"; return cont(maybeFrom, expect(";")); }
|
| if (value == "default") { cx.marked = "keyword"; return cont(expression, expect(";")); }
|
| - if (type == "{") return cont(commasep(exportField, "}"), maybeFrom, expect(";"));
|
| return pass(statement);
|
| - }
|
| - function exportField(type, value) {
|
| - if (value == "as") { cx.marked = "keyword"; return cont(expect("variable")); }
|
| - if (type == "variable") return pass(expressionNoComma, exportField);
|
| }
|
| function afterImport(type) {
|
| if (type == "string") return cont();
|
| - return pass(importSpec, maybeMoreImports, maybeFrom);
|
| + return pass(importSpec, maybeFrom);
|
| }
|
| function importSpec(type, value) {
|
| if (type == "{") return contCommasep(importSpec, "}");
|
| if (type == "variable") register(value);
|
| if (value == "*") cx.marked = "keyword";
|
| return cont(maybeAs);
|
| - }
|
| - function maybeMoreImports(type) {
|
| - if (type == ",") return cont(importSpec, maybeMoreImports)
|
| }
|
| function maybeAs(_type, value) {
|
| if (value == "as") { cx.marked = "keyword"; return cont(importSpec); }
|
|
|