Commit b6e2b836

b6e2b8364eebMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 2 files · ~2 modified

Description

Dir.exist? and at_exit

Dir.exist?/exists?(path) -> sp_file_directory (bool).

at_exit { ... } registers the block as a Proc in sp_at_exit_hooks; main()'s tail runs the hooks in reverse registration order (LIFO), reusing the first-class Proc lowering to build each hook.

make test: 175 pass / 5 fail / 664 error (was 173 / 5 / 666), no regressions.

Co-Authored-By: Claude Opus 4.8 (1M context) [email protected]

Details

Commit
b6e2b8364eeb
Parent
4a364af74ee5

src/analyze.cmodifiedView file

@@ -293,6 +293,10 @@
293293 nt_str(nt, recv, "name") && !strcmp(nt_str(nt, recv, "name"), "Process") &&
294294 (!strcmp(name, "pid") || !strcmp(name, "ppid")))
295295 return TY_INT;
296+ if (rty && !strcmp(rty, "ConstantReadNode") &&
297+ nt_str(nt, recv, "name") && !strcmp(nt_str(nt, recv, "name"), "Dir") &&
298+ (!strcmp(name, "exist?") || !strcmp(name, "exists?")))
299+ return TY_BOOL;
296300 }
297301
298302 /* Time instance methods */