On Wed, Nov 20, 2013 at 8:32 AM, Alexander Kornienko <[email protected]>wrote:
> On Wed, Nov 20, 2013 at 4:03 PM, Daniel Jasper <[email protected]> wrote: > >> + >>> +TEST_F(FormatTest, UnderstandsJavaScript) { >>> + verifyFormat("a === b;"); >>> + verifyFormat("aaaaaaa === b;", getLLVMStyleWithColumns(10)); >>> >> >> How is this the correct format? Wouldn't we expect a break before "b"? >> > > This need some work still, this patch just stops clang-format from > breaking the code by inserting a space inside these operators. I'll add a > FIXME to the test and a commented out test with the correct formatting. > ok. > > >> >> >>> + verifyFormat("a !== b;"); >>> + verifyFormat("aaaaaaa !== b;", getLLVMStyleWithColumns(10)); >>> +} >>> + >>> >> >> Also, I think these tests are not sufficient. What if the LHS of one of >> these operators needs to be broken over multiple lines (there is a whole >> lot of logic of what happens to the RHS then)? >> > > I'll add more complex tests (probably, commented-out, as we don't get this > quite right yet). > > I think we actually might need to merge the tokens. >> > > I was thinking about this. What if we just "hide" the "=", so that > clang-format thinks there's just == or !=? I don't think we need to have > any logic specific to javascript identity operators. > Yes. We'll also need to increase the length of the token, but other than that this is what I mean by "merging". > >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
