Assigns a token type (TT_JsFatArrow) to => tokens, and uses that to
more easily recognize and format fat arrow functions.
Improves function parsing to better recognize formal parameter
lists and return type declarations.
Recognizes arrow functions and parse function bodies as child blocks.
Details
- Reviewers
klimek
Diff Detail
Event Timeline
lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
885–887 | Seems like they have TokenKind TT_JsFatArrow now. | |
1042–1043 | Most of the time we enter parse* functions with the first token of that projection. In this case, I'd expect the current token still be the OpenKind. | |
1046 | Nit: add '.' | |
1048 | Use pre-increment in C++. | |
lib/Format/UnwrappedLineParser.h | ||
110–114 | a) use doxygen comments for functions |
PTAL.
lib/Format/UnwrappedLineParser.cpp | ||
---|---|---|
885–887 | It has TokenType TT_JsFatArrow, but tok::TokenKind tok::equal. Don't blame me, I'm just the messenger :-) Updated the comment to be explicit about tok::TokenKind. | |
1042–1043 | Done, that's better indeed. | |
1046 | Done. | |
1048 | Done. | |
lib/Format/UnwrappedLineParser.h | ||
110–114 | (a): done. |
a) use doxygen comments for functions
b) we usually don't have nested parens or nested blocks where there can't be anything in we'd want to parse explicitly; I assume you know what you're doing for JS here, but I find that really curious