[PATCH] D134652: [clang-format] Add Really Basic Carbon Support/Infrastructure

MyDeveloperDay via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 26 10:37:15 PDT 2022


MyDeveloperDay updated this revision to Diff 462966.
MyDeveloperDay added a comment.

Treat a class like a C# or Javascript class there is no semi after the brace `};`

  class Sum {
    var a: i32;
    fn Add[me:Self](var num: i32) -> i32 {
      var total: i32 = me.a + num;
      return total;
    }
  }
  fn Main() -> i32 {
    var p1: Sum = {.a = 5};
    var total: i32 = p1.Add(5);
    Print("Total sum {0}", total);
    return 0;
  }


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134652/new/

https://reviews.llvm.org/D134652

Files:
  clang/docs/ClangFormatStyleOptions.rst
  clang/include/clang/Format/Format.h
  clang/lib/Format/Format.cpp
  clang/lib/Format/FormatToken.h
  clang/lib/Format/TokenAnnotator.cpp
  clang/lib/Format/UnwrappedLineParser.cpp
  clang/tools/clang-format/ClangFormat.cpp
  clang/unittests/Format/CMakeLists.txt
  clang/unittests/Format/FormatTestCarbon.cpp
  clang/unittests/Format/TokenAnnotatorTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D134652.462966.patch
Type: text/x-patch
Size: 13860 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220926/fe951900/attachment.bin>


More information about the cfe-commits mailing list