[all-commits] [llvm/llvm-project] a7638d: clang-format: [JS] support null operators.

Martin Probst via All-commits all-commits at lists.llvm.org
Mon Nov 11 07:35:45 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: a7638d384983e8e3eb44a2d8c757238efc7096dc
      https://github.com/llvm/llvm-project/commit/a7638d384983e8e3eb44a2d8c757238efc7096dc
  Author: Martin Probst <martin at probst.io>
  Date:   2019-11-11 (Mon, 11 Nov 2019)

  Changed paths:
    M clang/lib/Format/FormatToken.h
    M clang/lib/Format/FormatTokenLexer.cpp
    M clang/unittests/Format/FormatTestJS.cpp

  Log Message:
  -----------
  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




More information about the All-commits mailing list