-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correct parsing for f-string string literal concatenation
Fixes #91 Add support for f-string literal concatenation in the Python parser. * **Py.java** - Add a new nested `StringLiteralConcatenation` type to handle string literal concatenation. - Implement `getType()` to return `JavaType.Primitive.String`. - Implement `setType()` to return `this`. * **_parser_visitor.py** - Update the `visit_Constant` method to handle string literal concatenation combined with f-strings. - Add logic to produce `Py.StringLiteralConcatenation` nodes for string literal concatenation. - Update the `__map_fstring` method to handle the difficult piece of logic for f-string concatenation. * **fstring_test.py** - Add tests to verify correct parsing of string literal concatenation combined with f-strings. - Add tests to verify correct parsing of f-string literal concatenation with comments. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/openrewrite/rewrite-python/issues/91?shareId=XXXX-XXXX-XXXX-XXXX).
- Loading branch information
1 parent
86e6295
commit c210036
Showing
3 changed files
with
154 additions
and
18 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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