Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Spaces in def setup() definition are tripping up the run_sketch utility #314

Closed
hx2A opened this issue Jul 8, 2023 · 0 comments · Fixed by #315
Closed

Spaces in def setup() definition are tripping up the run_sketch utility #314

hx2A opened this issue Jul 8, 2023 · 0 comments · Fixed by #315

Comments

@hx2A
Copy link
Collaborator

hx2A commented Jul 8, 2023

Things that don't work that should:

def setup( ):
    size(200, 200)

def draw( ):
    rect(mouse_x, mouse_y, 10, 10)
def setup ():
    size(200, 200)

def draw ():
    rect(mouse_x, mouse_y, 10, 10)

This is closely related to #160 and I know I made a fix for this specifically but it seems I didn't test it well enough. If setup() has extra spaces but draw() does not, it works correctly. If draw() has extra spaces or is not defined for this Sketch, it does have a problem.

To fix this I need to take the regex I wrote to address this before and apply it to two other locations in py5_tools/parsing.py and py5_tools/imported.py.

Thanks to @villares for finding this bug.

@hx2A hx2A mentioned this issue Jul 8, 2023
@hx2A hx2A closed this as completed in #315 Jul 8, 2023
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 a pull request may close this issue.

1 participant