nyash-codex
88400e7e22
feat(joinir): Phase 171-C-2 Trim pattern detection in LoopBodyCarrierPromoter
Implements the Trim pattern detection logic for carrier promotion:
- find_definition_in_body(): Iterative AST traversal to locate variable definitions
- is_substring_method_call(): Detects substring() method calls
- extract_equality_literals(): Extracts string literals from OR chains (ch == " " || ch == "\t")
- TrimPatternInfo: Captures detected pattern details for carrier promotion
This enables Pattern 5 to detect trim-style loops:
```hako
loop(start < end) {
local ch = s.substring(start, start+1)
if ch == " " || ch == "\t" || ch == "\n" || ch == "\r" {
start = start + 1
} else {
break
}
}
```
Unit tests cover:
- Simple and nested definition detection
- substring method call detection
- Single and chained equality literal extraction
- Full Trim pattern detection with 2-4 whitespace characters
Next: Phase 171-C-3 integration with Pattern 2/4 routing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-07 23:09:25 +09:00
..
2025-12-07 21:09:01 +09:00
2025-11-21 06:25:17 +09:00
2025-12-04 23:51:49 +09:00
2025-12-05 23:26:55 +09:00
2025-11-30 04:35:40 +09:00
2025-12-07 21:56:39 +09:00
2025-12-07 03:12:51 +09:00
2025-12-04 21:58:45 +09:00
2025-12-07 23:09:25 +09:00
2025-11-30 14:30:28 +09:00
2025-12-05 19:39:54 +09:00
2025-12-05 23:33:06 +09:00
2025-12-05 21:58:54 +09:00
2025-12-03 13:59:06 +09:00
2025-11-30 09:38:28 +09:00
2025-11-30 04:35:40 +09:00
2025-11-24 15:02:51 +09:00
2025-11-21 06:25:17 +09:00
2025-12-03 13:59:06 +09:00
2025-12-05 23:26:55 +09:00
2025-12-06 00:20:45 +09:00
2025-12-03 13:59:06 +09:00
2025-12-03 13:59:06 +09:00
2025-11-21 06:25:17 +09:00
2025-12-05 17:22:14 +09:00
2025-12-03 13:59:06 +09:00
2025-09-17 07:43:07 +09:00
2025-11-30 04:35:40 +09:00
2025-12-05 15:45:42 +09:00
2025-12-05 15:45:42 +09:00
2025-11-24 15:02:51 +09:00
2025-11-24 14:17:02 +09:00
2025-12-05 07:47:22 +09:00
2025-11-24 14:17:02 +09:00
2025-09-17 07:43:07 +09:00
2025-12-03 13:59:06 +09:00
2025-11-30 04:35:40 +09:00
2025-12-05 19:39:54 +09:00
2025-11-24 15:02:51 +09:00
2025-09-24 09:30:42 +09:00
2025-11-24 15:02:51 +09:00
2025-11-21 06:25:17 +09:00
2025-11-17 09:45:03 +09:00
2025-11-24 15:02:51 +09:00
2025-11-21 06:25:17 +09:00
2025-12-03 13:59:06 +09:00