From a7638d384983e8e3eb44a2d8c757238efc7096dc Mon Sep 17 00:00:00 2001 From: Martin Probst Date: Thu, 7 Nov 2019 23:39:03 +0100 Subject: 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 --- clang/lib/Format/FormatToken.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'clang/lib/Format/FormatToken.h') 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) \ -- cgit v1.2.3