Commit 8bb23dfd

8bb23dfdde79Merged

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

Description

Add String#hex, fix string-range size, fix Range nil? early return

  • String#hex -> sp_str_to_i_base(s, 16)
  • Range#size on string-literal range: emit SP_INT_NIL early (before creating sp_Range temp) to avoid int-conversion warning/-Werror

Co-Authored-By: Claude Sonnet 4.6 [email protected]

Details

Commit
8bb23dfdde79
Parent
1a9972db97f7

src/analyze.cmodifiedView file

@@ -994,7 +994,8 @@
994994 if (aty && !strcmp(aty, "RegularExpressionNode")) return TY_POLY; /* nil on no match */
995995 }
996996 if (!strcmp(name, "index") || !strcmp(name, "to_i") || !strcmp(name, "count") ||
997- !strcmp(name, "oct") || !strcmp(name, "ord") || !strcmp(name, "casecmp") ||
997+ !strcmp(name, "oct") || !strcmp(name, "hex") || !strcmp(name, "ord") ||
998+ !strcmp(name, "casecmp") ||
998999 !strcmp(name, "bytesize") || !strcmp(name, "setbyte") || !strcmp(name, "getbyte")) return TY_INT;
9991000 if (!strcmp(name, "scrub") || !strcmp(name, "crypt")) return TY_STRING;
10001001 if (!strcmp(name, "rindex")) return TY_INT;