Commit da4b8000
da4b80006edcMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 5 months ago · 2 files · ~2 modified
Description
Add Regexp.new codegen + match? for dynamic regex, fix bitwise-shift poly rhs
- analyze: Regexp.new(...) infers TY_REGEX instead of TY_UNKNOWN
- codegen: Regexp.new emits re_compile() call, stores in mrb_regexp_pattern* local
- codegen: TY_REGEX local vars work as match? / === / =~ receiver via fallback path that materialises the pattern pointer from the local variable
- codegen: integer bitwise-shift/and/or/xor wraps TY_POLY rhs in sp_poly_to_i() to fix CC error when right operand comes from a poly array element
Co-Authored-By: Claude Sonnet 4.6 [email protected]
Details
- Commit
- da4b80006edc
- Parent
- 403d76c3877d
src/analyze.cmodifiedView file
@@ -359,6 +359,7 @@
359359
if (cn && !strcmp(cn, "StringIO")) return TY_STRINGIO;360360
if (cn && !strcmp(cn, "StringScanner")) return TY_STRINGSCANNER;361361
if (cn && !strcmp(cn, "Hash")) return TY_SYM_POLY_HASH;362+
if (cn && !strcmp(cn, "Regexp")) return TY_REGEX;362363
}363364
}364365
src/codegen.cmodifiedView file
Loading diff…