Details
Details
- Reviewers
djasper
Diff Detail
Diff Detail
Event Timeline
Comment Actions
Properly handle exports followed by declarations ((default)? const, class, function, var).
| lib/Format/TokenAnnotator.cpp | ||
|---|---|---|
| 1762–1763 | Line.First->isOneOf(Keywords.kw_import, tok::kw_export) | |
| lib/Format/UnwrappedLineParser.cpp | ||
| 737 | I'd add: if (Style.Language == FormatStyle::LK_JavaScript) {
parseJavaScriptEs6ImportExport();
return;
}
break;here and not fall through or change the block below. | |
| 744–746 | Line.First->isOneOf(Keywords.kw_import, tok::kw_export) | |
| 1612 | Maybe assert instead of the comment? | |
| 1623 | I'd probably use if statements instead of the switch. Seems a bit bad to mix switch and if (which you can't avoid because of Keywords): if (FormatTok->isOneOf(tok::kw_const, tok::kw_class,
Keywords.kw_function, Keywords.kw_var))
return; // Fall through to parsing the corresponding structure.
if (FormatTok->is(tok::kw_default)) {
nextToken();
return;
}
if (FormatTok->is(tok::l_brace)) {
FormatTok->BlockKind = BK_Block;
parseBracedList();
} | |