Commit d2a5bfa8

d2a5bfa81580Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 4 files · +2 added · ~2 modified

Description

codegen,analyze: File::SEPARATOR/PATH_SEPARATOR/ALT_SEPARATOR

ConstantPathNode File::* separators previously fell through to the default emit File_SEPARATOR (undeclared C identifier). Resolve as string literal at compile time. POSIX path semantics hardcoded -- File::SEPARATOR is "/" everywhere spinel targets, File::PATH_SEPARATOR is ":", File::ALT_SEPARATOR is empty on POSIX.

Refs #891

Co-Authored-By: Claude Opus 4.7 [email protected]

Details

Commit
d2a5bfa81580
Parent
efd722c62538

spinel_analyze.rbmodifiedView file

@@ -2347,6 +2347,13 @@
23472347 if rname == "Math"
23482348 return "float"
23492349 end
2350+ # Issue #891: File::SEPARATOR / ALT_SEPARATOR / PATH_SEPARATOR.
2351+ if rname == "File"
2352+ nn_file = @nd_name[nid]
2353+ if nn_file == "SEPARATOR" || nn_file == "ALT_SEPARATOR" || nn_file == "PATH_SEPARATOR"
2354+ return "string"
2355+ end
2356+ end
23502357 end
23512358 return "int"
23522359 end