Skip to content

Include a file every time it is named; notice edited includes - #18

Merged
revarbat merged 1 commit into
masterfrom
fix/include-repeat-and-cache
Sep 26, 2026
Merged

revarbat merged 1 commit into
masterfrom
fix/include-repeat-and-cache

Conversation

@revarbat

Copy link
Copy Markdown
Member

The same two fixes as openscad_parser #32.

Repeated include. A file included twice, or reached through two others, was included once. OpenSCAD 2026.02.01 includes it every time, and refuses only a file already open on the current include chain (the top-level file isn't one). The tests are the same four cases, each matching the reference's ECHO output.

Edited include. The resolved cache was keyed only on the top file's modification time, so an edited include kept serving the old tree. It now records every file a resolution read, and a cached tree is used only while none of them has changed.

For openscad_evaluator, which uses this parser: BOSL2's std.scad resolves to the same 1,341 top-level nodes as before, all 1,050 evaluator tests pass against this branch, and a 30-cuboid BOSL2 script's resolve time is unchanged (~1,040 ms).

1,188 tests pass, including 4 new ones.

🤖 Generated with Claude Code

Same fix as openscad_parser #32. A single visited set spanned the whole
resolution, so a file was included at most once; OpenSCAD includes it each
time and refuses only a file open on the current include chain (the top
file is not one). The resolved cache now records every file a resolution
read and is valid only while none has changed -- keyed on the top file
alone, an edited include kept serving the old tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@revarbat
revarbat merged commit e4a213e into master Sep 26, 2026
3 checks passed
@revarbat
revarbat deleted the fix/include-repeat-and-cache branch September 26, 2026 10:50
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 this pull request may close these issues.

1 participant