This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] fix async parsing.
ClosedPublic

Authored by mprobst on May 27 2016, 10:40 AM.

Details

Summary

Only treat the sequence async function as the start of a function expression,
as opposed to every occurrence of the token async (whoops).

Also refactors AnnotatedLine.startsWith/endsWith by extracting the core functionality
into FormatToken.startsSequence/endsSequence. This allows checking tokens within
the pointered linked list structure with a lookahead, automatically ignoring
comments, which is useful in many places (e.g. see subsequent commit).

Diff Detail

Event Timeline

mprobst updated this revision to Diff 58808.May 27 2016, 10:40 AM
mprobst retitled this revision from to clang-format: [JS] FormatToken.startsSequence/endsSequence..
mprobst updated this object.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
mprobst updated this revision to Diff 58809.May 27 2016, 10:43 AM
  • fix description
mprobst retitled this revision from clang-format: [JS] FormatToken.startsSequence/endsSequence. to clang-format: [JS] fix async parsing..May 27 2016, 10:43 AM
mprobst updated this object.
djasper accepted this revision.May 29 2016, 7:05 AM
djasper edited edge metadata.

Looks good.

This revision is now accepted and ready to land.May 29 2016, 7:05 AM
This revision was automatically updated to reflect the committed changes.