[PATCH] D20737: clang-format: [JS] FormatToken.startsSequence/endsSequence.

Martin Probst via cfe-commits cfe-commits at lists.llvm.org
Fri May 27 10:40:45 PDT 2016


mprobst created this revision.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
Herald added a subscriber: klimek.

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).

clang-format: [JS] fix async parsing.

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

http://reviews.llvm.org/D20737

Files:
  lib/Format/FormatToken.h
  lib/Format/TokenAnnotator.h
  lib/Format/UnwrappedLineParser.cpp
  unittests/Format/FormatTestJS.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D20737.58808.patch
Type: text/x-patch
Size: 7244 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160527/0aa9541a/attachment-0001.bin>


More information about the cfe-commits mailing list