Commit ed57f56e

ed57f56e9e9eMerged

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

Description

fix(parse): skip malformed require_relative lines instead of aborting

resolve_requires in spinel_parse.c bailed out of its scan loop the moment it hit a malformed require_relative line — an unparseable quote on either side reached break, abandoning every subsequent require_relative in the file. Same silent-failure shape as the bug fixed for the leading scan in c1c1058 and called out as out-of-scope there. PR #31 caught this; the rest of that PR's changes (per-recursion visited[] cursor + resolve_requires_impl wrapper, spinel_parse.rb sibling fix) are now obsolete: the visited-set approach was superseded by PR #28's global sp_included_paths dedup, and spinel_parse.rb was dropped entirely in 80bd08d.

Closes #12 follow-up. Lands the slim residue of #31.

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

Refs #31

Details

Commit
ed57f56e9e9e
Parent
f5e973070dfe

spinel_parse.cmodifiedView file

@@ -879,10 +879,10 @@
879879 } else if (q2 && q2 < line_end) {
880880 quote_char = '\'';
881881 start = q2 + 1;
882- } else break;
882+ } else { scan_from = pos + 1; continue; }
883883
884884 char *end = strchr(start, quote_char);
885- if (!end || end > line_end) break;
885+ if (!end || end > line_end) { scan_from = pos + 1; continue; }
886886
887887 size_t path_len = end - start;
888888 char rel_path[512];