ffd8 / P5LIVE

p5.js collaborative live-coding vj environment!
https://p5live.org
GNU General Public License v3.0
226 stars 35 forks source link

Add opening bracket as requirement for function matching #23

Closed JunShern closed 4 years ago

JunShern commented 4 years ago

When looking for instances of our function, add the requirement that the function name needs to be followed with a '(' character.

Otherwise for example if we have two functions, myFunc and myFunc1 and we are looking for myFunc, then the second function will be mistakenly matched. By including the '(', we will search for myFunc( and thus myFunc1 will not be matched.

ffd8 commented 4 years ago

Another good catch – I mis-read what you were checking here.. good idea to check for the ( when comparing where the function is called to avoid similar named ones.