Commit 32b80581
32b80581f87aMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 2 files · ~2 modified
Description
Dir.mkdir / rmdir / chdir / glob / home dispatch
Wire the remaining Dir singleton methods to their long-present runtime helpers (only the dispatch was missing): mkdir/rmdir/chdir return a status int, glob a sorted str_array, home the home directory path.
Co-Authored-By: Claude Opus 4.8 [email protected]
Details
- Commit
- 32b80581f87a
- Parent
- f2a5f786e830
src/analyze.cmodifiedView file
@@ -360,9 +360,12 @@
360360
(!strcmp(name, "exist?") || !strcmp(name, "exists?")))361361
return TY_BOOL;362362
if (rty && !strcmp(rty, "ConstantReadNode") &&363-
nt_str(nt, recv, "name") && !strcmp(nt_str(nt, recv, "name"), "Dir") &&364-
!strcmp(name, "pwd"))365-
return TY_STRING;363+
nt_str(nt, recv, "name") && !strcmp(nt_str(nt, recv, "name"), "Dir")) {364+
if (!strcmp(name, "pwd") || !strcmp(name, "home")) return TY_STRING;365+
if (!strcmp(name, "glob")) return TY_STR_ARRAY;366+
if (!strcmp(name, "mkdir") || !strcmp(name, "rmdir") || !strcmp(name, "chdir"))367+
return TY_INT;368+
}366369
if (rty && !strcmp(rty, "ConstantReadNode") &&367370
nt_str(nt, recv, "name") && !strcmp(nt_str(nt, recv, "name"), "File")) {368371
if (!strcmp(name, "basename") || !strcmp(name, "dirname") || !strcmp(name, "extname") ||src/codegen.cmodifiedView file
Loading diff…