vm(hako): add v1 reader/dispatcher (flagged), commonize mir_call handler, share block scan; smokes: add v1 hakovm canary; docs: 20.37/20.38 plans, OOB policy; runner: v1 hakovm toggle; include SKIP summary
This commit is contained in:
@ -496,11 +496,38 @@ pub fn parse_preludes_to_asts(
|
||||
eprintln!("[strip-debug] Parse FAILED for: {} (debug={})", prelude_path, debug);
|
||||
if debug {
|
||||
eprintln!("[strip-debug] Error: {}", e);
|
||||
let es = format!("{}", e);
|
||||
let lines: Vec<&str> = clean_src.lines().collect();
|
||||
eprintln!("[strip-debug] Total lines: {}", lines.len());
|
||||
eprintln!("[strip-debug] Lines 15-25:");
|
||||
for (idx, line) in lines.iter().enumerate().skip(14).take(11) {
|
||||
eprintln!(" {:3}: {}", idx + 1, line);
|
||||
// Try to extract error line number (e.g., "at line 451") and show local context
|
||||
let mut printed = false;
|
||||
if let Some(pos) = es.rfind("line ") {
|
||||
let mut j = pos + 5; // after "line "
|
||||
let bytes = es.as_bytes();
|
||||
let mut n: usize = 0; let mut had = false;
|
||||
while j < bytes.len() {
|
||||
let c = bytes[j];
|
||||
if c >= b'0' && c <= b'9' { n = n * 10 + (c - b'0') as usize; j += 1; had = true; } else { break; }
|
||||
}
|
||||
if had {
|
||||
let ln = if n == 0 { 1 } else { n };
|
||||
let from = ln.saturating_sub(3);
|
||||
let to = std::cmp::min(lines.len(), ln + 3);
|
||||
eprintln!("[strip-debug] Context around line {} ({}..={}):", ln, from.max(1), to);
|
||||
for i in from.max(1)..=to {
|
||||
let mark = if i == ln { ">>" } else { " " };
|
||||
if let Some(line) = lines.get(i-1) {
|
||||
eprintln!("{} {:4}: {}", mark, i, line);
|
||||
}
|
||||
}
|
||||
printed = true;
|
||||
}
|
||||
}
|
||||
if !printed {
|
||||
eprintln!("[strip-debug] Lines 15-25:");
|
||||
for (idx, line) in lines.iter().enumerate().skip(14).take(11) {
|
||||
eprintln!(" {:3}: {}", idx + 1, line);
|
||||
}
|
||||
}
|
||||
eprintln!("[strip-debug] Full clean_src:\n{}\n---", clean_src);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user