Resolve "'Names Default To Here(0)' causes Name Unresolved error"
The error in issue #45 (closed) is avoided by explicitly scoping all variables so that they can be accessed at all times. I also put all variables used in the script in an anonymous namespace to avoid any name collisions.
Also to allow Names default to here to switch I noticed that including the blob did not make the scoping switch permanently. e.g.
include(chartoblob("x = 1"));
include(chartoblob("names default to here(1);")); // This does not make a permanent switch
include(chartoblob("x = 2;")); // Should be assigned to here:x
here:x // Doesn't exist
eval(include(buffer, <<parseOnly)) seems to work as expected.
I also wrapped the eval in logcapture(print()) so that everything that would show in the JMP log is sent to VSCode including errors and prints.
Closes #45 (closed)
Edited by Vince Faller