clang-format: [JS] ASI insertion after boolean literals.
authorMartin Probst <martin@probst.io>
Sun, 18 Sep 2016 17:21:52 +0000 (17:21 +0000)
committerMartin Probst <martin@probst.io>
Sun, 18 Sep 2016 17:21:52 +0000 (17:21 +0000)
commitb9316ff84979e53260c1c3bcbfa0359a891ad1a9
tree049f355dfda8add7ec28ec57a603fea2e8c6d778
parent3f307518f8bea834e7ba0fb522e990063d09cfb3
clang-format: [JS] ASI insertion after boolean literals.

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.

Reviewers: djasper

Subscribers: klimek, cfe-commits

Differential Revision: https://reviews.llvm.org/D24574

llvm-svn: 281856
clang/lib/Format/UnwrappedLineParser.cpp
clang/unittests/Format/FormatTestJS.cpp