[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 09:32:12 PDT 2022


MyDeveloperDay created this revision.
MyDeveloperDay added reviewers: chandlerc, HazardyKnusperkeks, owenpan, curdeius, klimek.
MyDeveloperDay added projects: clang-format, clang.
Herald added a project: All.
MyDeveloperDay requested review of this revision.

Its great when clang-format is the ubiquitous tool for all formatting regardless of the language. clang-formats existing integration into common editors/IDEs means we can build on the clang-format legacy to help contribute in a small way to the future of Carbon, simply by helping providing native Carbon support.

Following the excellent talk by @chandlerc et al at CppNorth (https://www.youtube.com/watch?v=omrY53kbVoA). On seeing the suggested syntax it was clear that clang-format would face some new challenges. (which might be exciting to work on)

This review is to add the basic infrastructure for Carbon as a potential clang-format language, to begin building that infrastructure and to fix a couple of Annotator issues which caused problems even with the simple language examples, namely "spaces around trailing return arrows and an additional space between type and colon in variable declarations"

I'm mainly submitting this to gauge interest from the team, and to see if others feel this might be something that we are interested in pursuing. (its also a good way to learn about Carbon.)


Repository:
  rG LLVM Github Monorepo

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/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.462937.patch
Type: text/x-patch
Size: 11789 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220926/3799dfb6/attachment.bin>


More information about the cfe-commits mailing list