Skip to content

Conversation

@flit
Copy link
Member

@flit flit commented May 26, 2023

Support C-style assignment expressions, such that variables can be assigned to in the middle of other expressions. Just as in C, the value of an assignment expression is the value assigned to the variable. While this syntax isn't documented in the Open-CMSIS-Pack specification, it is used in the Keil.LPC800_DFP pack and therefore is implicitly supported by debug sequences.

The patch replaces the assign_stmt AST node with assign_expr, with the lowest precedence (same precedence as in C).

Fixes #1563

Support C-style assignment expressions, such that variables can be
assigned to in the middle of other expressions. Just as in C, the
value of an assignment expression is the value assigned to the variable.
While this syntax isn't documented in the Open-CMSIS-Pack specification,
it is used in the Keil.LPC800_DFP pack and therefore is implicitly
supported by debug sequences.

The patch replaces the assign_stmt AST node with assign_expr, with the
lowest precedence (same precedence as in C).
@flit
Copy link
Member Author

flit commented May 26, 2023

@imi415 Could you test this PR if you have time, please? Thanks! 🙏🏽

@imi415
Copy link
Contributor

imi415 commented May 27, 2023

@imi415 Could you test this PR if you have time, please? Thanks! 🙏🏽

Hi @flit , I have tested this on LPC804M101JHI33, it appears this PR does fixes this issue. Thanks!

@flit
Copy link
Member Author

flit commented May 28, 2023

@imi415 Thanks for testing!

@flit flit merged commit 035f81b into pyocd:main May 28, 2023
@flit flit deleted the bugfix/debug_seq_assign_expr branch May 28, 2023 18:41
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.

debug sequences: Assignment expression could have return values

2 participants