Skip to content

Conversation

@davepagurek
Copy link
Contributor

This fixes two issues identified in the last p5 discord call:

1. State modification in a deeply nested for loop doesn't work

This is because branches need to detect what variables are modified inside of them to correctly construct a control flow graph. They were intentionally not traversing into nested loops, since those have already parsed inside of them, but we still needed to grab the modification list from those nested loops and propagate them out.

2. You can't early return from branches

Previously we assumed a single final return value. I've added handling for early returns now.

Here's an updated version of the looping game of life shader with this build: https://editor.p5js.org/davepagurek/sketches/33ZrbAhDN

@davepagurek davepagurek merged commit dd27465 into dev-2.0 Jan 10, 2026
5 checks passed
@davepagurek davepagurek deleted the fix/strands-branching branch January 10, 2026 02:02
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