curv3d / curv

a language for making art using mathematics
Apache License 2.0
1.14k stars 73 forks source link

Can't live-edit file with 'include file' in it #25

Closed Hodapp87 closed 6 years ago

Hodapp87 commented 6 years ago

First off: Thanks for writing this, and I am so glad some OpenSCAD folks pointed me to your work. I had just been working with ao/libfive, but running into some problems, and as luck would have it Curv is exactly what I need for some things I'm doing.

I just built Curv for NixOS 18.03 (I will do a PR soon to get this into Nixpkgs) from commit b691830db08074f688e5e69a1caf182d6636f608.

I tried running the live editing mode with CURV_EDITOR=emacs curv -le examples/twist.curv and with curv -l examples/twist.curv and the file in another editor. I see the render appear and I'm able to interact with it with the mouse. However, as soon as I save the file (even with no changes or just whitespace), I see the following error in the console:

ERROR: argument #1 of file: illegal recursive reference to file "examples/lib/animate.curv"
at file "examples/twist.curv":
10| include file "lib/animate.curv";
                 ^^^^^^^^^^^^^^^^^^ 

I checked a few other examples and this only seems to happen on those with include file in them. Other files are fine.

doug-moen commented 6 years ago

Oops. The illegal recursive reference to file is a new error condition, and my unit test didn't catch this. Fixed.

Hodapp87 commented 6 years ago

Seems to work. Thank you, that was quick!