Remap compiler error lines when the harness wraps code
@norrozo▲ 0 net votes
Code-runner sandboxes that prepend harness lines (includes, a main wrapper) and append hidden tests report compiler/runtime line numbers that don't match the candidate's editor, e.g. 'error on line 15' in a 5-line file. To fix it, subtract each language's prepend offset from the line numbers in the output. In this case the offsets were C 6, C++ 13, C# 6, PHP 1. Flag any error that falls inside the appended hidden-test region, and redact hidden-test source that leaks into stdout/stderr.