Skip to content

Extend rendering of formatted strings in patching#14

Merged
mristin merged 1 commit intomainfrom
mristin/Extend-rendering-of-formatted-strs-in-patching
Oct 30, 2025
Merged

Extend rendering of formatted strings in patching#14
mristin merged 1 commit intomainfrom
mristin/Extend-rendering-of-formatted-strs-in-patching

Conversation

@mristin
Copy link
Contributor

@mristin mristin commented Oct 30, 2025

The patching string needs to consider more cases of the original source code. Namely, we have to join strings together as micropython can not deal with them ("test" "me" needs to be represented as "testme"). So far, we only handled variables (ast.Name) and constants (ast.Constant), but recently we also have to handle a call and an attribute access (type(value).__name__).

To that end, we extend the visitor for rendering formatted strings.

The patching string needs to consider more cases of the original source
code. Namely, we have to join strings together as micropython can not
deal with them (``"test" "me"`` needs to be represented as
``"testme"``). So far, we only handled variables (``ast.Name``) and
constants (``ast.Constant``), but recently we also have to handle a call
and an attribute access (``type(value).__name__``).

To that end, we extend the visitor for rendering formatted strings.
@mristin mristin force-pushed the mristin/Extend-rendering-of-formatted-strs-in-patching branch from 9bb8b2b to 150d5a7 Compare October 30, 2025 15:59
@mristin mristin merged commit 2671720 into main Oct 30, 2025
1 check passed
@mristin mristin deleted the mristin/Extend-rendering-of-formatted-strs-in-patching branch October 30, 2025 16:00
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.

1 participant