processing / p5.js-editor

Deprecated desktop editor for p5.js
https://p5js.org
MIT License
339 stars 91 forks source link

Syntax parser thinks for loop scope variables are already defined. #296

Open Crayder opened 7 years ago

Crayder commented 7 years ago

Basically, for loop local scopes are considered to be part of the scope the for loop is in.

image image

Even in https://github.com/processing/p5.js-editor/blob/84dad397bd38781623f425c82ab57d06746aad38/public/mode_assets/p5/examples/Simulate/10_SoftBody.js where the for loops all use i, the p5 editor thinks the variables are already defined even though they are not in the same scope.