diff options
author | Martin Probst <martin@probst.io> | 2019-11-07 23:39:03 +0100 |
---|---|---|
committer | Martin Probst <martin@probst.io> | 2019-11-11 16:35:35 +0100 |
commit | a7638d384983e8e3eb44a2d8c757238efc7096dc (patch) | |
tree | 53214762176bda8ffaded6b59b65b643aaa1dbc3 /clang/lib/Format/FormatToken.h | |
parent | 48b7068beca9d3a39dcfbebcb384b59b7898065f (diff) | |
download | bcm5719-llvm-a7638d384983e8e3eb44a2d8c757238efc7096dc.tar.gz bcm5719-llvm-a7638d384983e8e3eb44a2d8c757238efc7096dc.zip |
clang-format: [JS] support null operators.
Summary:
JavaScript / TypeScript is adding two new operators: the null
propagating operator `?.` and the nullish coalescing operator `??`.
const x = foo ?? 'default';
const z = foo?.bar?.baz;
This change adds support to lex and format both.
Reviewers: krasimir
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69971
Diffstat (limited to 'clang/lib/Format/FormatToken.h')
-rw-r--r-- | clang/lib/Format/FormatToken.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Format/FormatToken.h b/clang/lib/Format/FormatToken.h index b11f36559a8..39498280fb6 100644 --- a/clang/lib/Format/FormatToken.h +++ b/clang/lib/Format/FormatToken.h @@ -60,6 +60,8 @@ namespace format { TYPE(JsExponentiationEqual) \ TYPE(JsFatArrow) \ TYPE(JsNonNullAssertion) \ + TYPE(JsNullishCoalescingOperator) \ + TYPE(JsNullPropagatingOperator) \ TYPE(JsPrivateIdentifier) \ TYPE(JsTypeColon) \ TYPE(JsTypeOperator) \ |