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

Putting the original code in the scad file can break the parser #210

Open
ali1234 opened this issue Jun 24, 2024 · 1 comment
Open

Putting the original code in the scad file can break the parser #210

ali1234 opened this issue Jun 24, 2024 · 1 comment

Comments

@ali1234
Copy link

ali1234 commented Jun 24, 2024

Example:

import solid

glob = "**/*"

x = solid.cube()
solid.scad_render_to_file(x, "test.scad")
y = solid.include("test.scad")

Result:

py_scadparser: Illegal character: test.scad(11) """
py_scadparser: Syntax error: test.scad(14) ID - solid
py_scadparser: Syntax error: test.scad(15) INCLUDE - include
py_scadparser: Syntax error: test.scad(18) / - /

This happens because the default is to save the solidpython code to the output, but in this case the code contains a glob, which looks like a comment terminator, which messes up the parser in solidpython. I haven't tested openscad on these files. Generally the way you fix this is with heredoc, but I think this would require support from openscad side.

@jeff-dh
Copy link
Contributor

jeff-dh commented Jun 24, 2024

solid2 should not have this issue (since it does not append the solidpython code to the scad file)

https://github.com/jeff-dh/SolidPython/tree/master-2.0.0-beta-dev

(I don't really see the need to append the solidpython code to the generated code)

PS: I don't really get what you mean with heredoc.

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

No branches or pull requests

2 participants