Before:
var b = a.map((x) = > x + 1);
After:
var b = a.map((x) => x + 1);
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209112
91177308-0d34-0410-b5e6-
96231b3b80d8
static tok::TokenKind JSNotIdentity[] = { tok::exclaimequal, tok::equal };
static tok::TokenKind JSShiftEqual[] = { tok::greater, tok::greater,
tok::greaterequal };
+ static tok::TokenKind JSRightArrow[] = { tok::equal, tok::greater };
// FIXME: We probably need to change token type to mimic operator with the
// correct priority.
if (tryMergeTokens(JSIdentity))
return;
if (tryMergeTokens(JSShiftEqual))
return;
+ if (tryMergeTokens(JSRightArrow))
+ return;
}
}
" bbbbbb :\n"
" ccc;",
getGoogleJSStyleWithColumns(20));
+
+ verifyFormat("var b = a.map((x) => x + 1);");
}
TEST_F(FormatTestJS, SpacesInContainerLiterals) {