Commit 02a294ee
02a294eeffcfMerged
Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 2 files · ~2 modified
Description
feat(analyze,codegen): regexp type scaffolding
First step of the #609 fix: introduces a regexp static type
representing mrb_regexp_pattern *. No call site consumes it yet
— the analyzer still infers Regexp.new(...) as int and the
existing single-write side-channel (@local_regex_idx) is intact.
Pieces:
- c_type("regexp") -> "mrb_regexp_pattern *"
- c_default_val("regexp") -> "NULL" (so a regexp? slot inits to nil)
- is_nullable_pointer_type("regexp") -> 1 (NULL is the sentinel)
The follow-up commits will (a) infer Regexp.new as the new type and
migrate the single-write path off the side-channel, (b) extend
if/else union to keep regexp + regexp as regexp instead of
collapsing to int, and (c) plumb the dyn-cache form.
Refs #609.
Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]
Details
- Commit
- 02a294eeffcf
- Parent
- 6eecc46a0840