Skip to content

Conversation

@Aayushdev18
Copy link

Summary

Adds support for LogicalExpression nodes in the p5.strands transpiler so that && and || conditions are correctly handled in if statements.

Changes

  • Added LogicalExpression handling alongside existing BinaryExpression logic
  • Ensures both operands are transpiled and logical operators are preserved
  • Added a unit test covering && and || conditions

Tests

  • Added a unit test that fails on dev-2.0 before this change and passes after

Resolves #8358

Add LogicalExpression handler to transpile logical operators to .or() and .and()
method calls. Fixes processing#8358.
@davepagurek
Copy link
Contributor

Thanks for taking this on! For the OR test, can we test both the left and the top? in the original buggy example, the left was already showing up red, so the rest as written would pass. But the buggy version of the code was not correctly making the top red because only part of the of condition was being evaluated.

For the AND test, rather than tearing right in the middle, which is where thr color should switch in this example, can we test a sample in each of the corners? just the bottom right should be filled in I think.

- OR test now verifies both left and top edges are red
- AND test now tests corners, with bottom-right being white and others black
Copy link
Contributor

@davepagurek davepagurek left a comment

Choose a reason for hiding this comment

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

Thanks for the updates, looks great!

@davepagurek davepagurek merged commit 9512db6 into processing:dev-2.0 Dec 26, 2025
2 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.

2 participants