Repository navigation
Conversation
Collaborator
Author
|
@Timple does this do what you were hoping for? |
Contributor
|
It is! |
christophfroehlich
requested changes
Oct 6, 2026
christophfroehlich
left a comment
Collaborator
There was a problem hiding this comment.
Looks great, thanks! Can we add some expressions to the examples please (both c++ and python)?
|
This pull request is in conflict. Could you fix it @tylerjw? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #381.
Allow numeric YAML defaults such as
default_value: "${pi/2}"to be evaluated during generation. The same arithmetic works in numeric array elements, fixed-size arrays, and validator arguments, and produces consistent C++, Python, Markdown, and RST output.The evaluator accepts numeric literals,
pi,tau,e, parentheses, unary signs, and+,-,*,/,//,%. It walks an allowlisted syntax tree without executing Python code. String parameters remain literal, and invalid expressions report the parameter name. Also correct the scalar type-error diagnostic so a floating-point expression assigned to an integer parameter reports a generation error.Validation: all 52 generator tests pass, including 32 new arithmetic, rejection, type-checking, and output-equivalence cases.