Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion runtime/syntax/cpp.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
filetype: c++

detect:
filename: "(\\.c(c|pp|xx)$|\\.h(h|pp|xx)?$|\\.ii?$|\\.(def)$)"
filename: "(\\.c(c(m)?|pp(m)?|xx(m)?|\\+\\+m?)$|\\.h(\\+\\+|h|pp|xx)?$|\\.i(i)?$|\\.(def|ino|inl|ipp|ixx|tpp|txx)$|\\.h(pp)?\\.in$)"
Copy link
Contributor

@niten94 niten94 Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't read or write C++ code, so I think you should not change anything based on this comment only and maybe wait until someone else comments.

A part of this change is good, since it seems to add filename extensions for C++20 modules. There currently seems to be a lot: https://stackoverflow.com/questions/75733706/what-is-the-file-extension-naming-convention-for-c20-modules

There are the only changes I suggest, from left to right in the changed line:

  • \\.c(c(m)?|pp(m)?|xx(m)?|\\+\\+m?)$\\.c(c|pp|xx|\\+\\+)m?$
  • \\.i(i)?$\\.ii?$: Revert, since it should probably be understood as "basic" syntax of regex that this matches example.i
  • ino: Remove since this is likely for Arduino code, which has a different file in Micro: arduino.yaml

Maybe \.h(pp)?\\.in$ should be removed, since I'm not sure we should recognize .in now in cpp.yaml only. Instead, Micro should probably ignore this on all filetypes.

I believe .in can be files in any language, with text like @PREFIX@ which a project's build system replaces. Actual examples I've seen are configuration, scripts, and patches.

signature: "\\b(namespace|class|public|protected|private|template|constexpr|noexcept|nullptr|throw)\\b"

rules:
Expand Down