Commit a322f39b

a322f39be6c1Merged

Yukihiro "Matz" Matsumoto <[email protected]> · 8 months ago · 1 file · ~1 modified

Description

Fix setter method names (trailing =), deep ivar scan, regex/exception detection in class methods, String += concat

  • sanitize_method: trailing = → _s suffix (prologue_first_lineno= etc)
  • scan_ivars_deep: recursive ivar detection from all method bodies
  • collect_regexp_patterns: scan required files and class methods
  • has_exception_nodes/has_split_calls: scan class/module bodies
  • Instance variable String +=: sp_str_concat instead of C +=
  • infer_type: PM_LOCAL/INSTANCE_VARIABLE_OPERATOR_WRITE_NODE

lrama: 310 → 198 C compile errors, 60/60 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) [email protected]

Details

Commit
a322f39be6c1
Parent
57a8389a71eb

src/codegen.cmodifiedView file

@@ -318,6 +318,7 @@
318318 memcpy(buf, name, len + 1);
319319 if (buf[len - 1] == '?') { buf[len - 1] = '_'; buf[len] = 'p'; buf[len + 1] = '\0'; }
320320 else if (buf[len - 1] == '!') { buf[len - 1] = '_'; buf[len] = 'b'; buf[len + 1] = '\0'; }
321+ else if (buf[len - 1] == '=') { buf[len - 1] = '_'; buf[len] = 's'; buf[len + 1] = '\0'; } /* setter */
321322 return buf;
322323 }
323324 return name;