This is an archive of the discontinued LLVM Phabricator instance.

clang-format: [JS] ASI insertion after boolean literals.
ClosedPublic

Authored by mprobst on Sep 14 2016, 10:16 AM.

Details

Summary

Before when a semicolon was missing after a boolean literal:

a = true
return 1;

clang-format would parse this as one line and format as:

a = true return 1;

It turns out that C++ does not consider true and false to be literals, we
have to check for that explicitly.

Diff Detail

Event Timeline

mprobst updated this revision to Diff 71385.Sep 14 2016, 10:16 AM
mprobst retitled this revision from to clang-format: [JS] ASI insertion after boolean literals..
mprobst updated this object.
mprobst added a reviewer: djasper.
mprobst added a subscriber: cfe-commits.
djasper accepted this revision.Sep 14 2016, 12:14 PM
djasper edited edge metadata.

Interesting.. Would have expected true/false to be literals as well, but ok :).

This revision is now accepted and ready to land.Sep 14 2016, 12:14 PM
This revision was automatically updated to reflect the committed changes.