This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] support `interface` as a free standing identifier.
ClosedPublic

Authored by mprobst on Apr 18 2016, 2:53 PM.

Details

Summary

interface can be used as a fee standing identifier in JavaScript/TypeScript.
This change uses the heuristic of whether it's followed by another identifier
as an indication.

Diff Detail

Event Timeline

mprobst updated this revision to Diff 54123.Apr 18 2016, 2:53 PM
mprobst retitled this revision from to clang-format: [JS] support `interface` as a free standing identifier..
mprobst updated this object.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
djasper added inline comments.Apr 19 2016, 5:32 AM
lib/Format/UnwrappedLineParser.cpp
1019

I wonder whether you can reuse mustBeJSIdentOrValue (possibly splitting apart the ..OrValue part).

mprobst updated this revision to Diff 54218.Apr 19 2016, 10:05 AM
  • reuse mustBeJSIdent for interface detection
mprobst marked an inline comment as done.Apr 19 2016, 10:06 AM
djasper accepted this revision.Apr 19 2016, 10:09 AM
djasper edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Apr 19 2016, 10:09 AM
This revision was automatically updated to reflect the committed changes.