Skip to content

Add (string-matching based) constexpr support to functions and methods#24

Merged
jbcoe merged 2 commits intomainfrom
feat-constexpr-support
Mar 27, 2026
Merged

Add (string-matching based) constexpr support to functions and methods#24
jbcoe merged 2 commits intomainfrom
feat-constexpr-support

Conversation

@jbcoe
Copy link
Copy Markdown
Owner

@jbcoe jbcoe commented Mar 27, 2026

No description provided.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds basic constexpr awareness to the C++ model layer by detecting constexpr on parsed functions/methods and reflecting it in their string representations, with corresponding test updates.

Changes:

  • Extend _Function to detect constexpr via token inspection and include it in formatting.
  • Introduce __str__ for _Function, Function, and Method (and align __repr__ to it).
  • Update tests/test_cppmodel.py to include and assert constexpr function/method rendering.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
tests/test_cppmodel.py Adds constexpr declarations to the sample source and asserts they appear in the model output.
src/xyz/cppmodel.py Detects constexpr and prepends it in function/method string formatting; adds __str__ implementations.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Collaborator

@nbx8 nbx8 left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@jbcoe jbcoe merged commit eeb0921 into main Mar 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants