Part of #617.
Problem
A C++ compiler error is unreadable to someone who has never seen one. The track's audience may not know what a compiler is, and the first chapter deliberately makes them read an error. Handing them 40 lines of template instantiation backtrace ends the session.
What to build
modules/ErrorHints.lua: a table of {pattern, explanation, pointer} matched against compiler stderr. The plain sentence prints first, the raw error only under --raw.
The compiler cannot find a name called 'RegisterSystm'.
Names in C++ are exact, including capital letters. You wrote 'RegisterSystm';
the engine spells it 'RegisterSystem'.
-> Exercise.cpp:14
(run with --raw to see the compiler's own message)
Around fifteen entries to start: unknown identifier, missing include, no member named, no matching function for a template call, incomplete type, missing semicolon, undefined reference at link time, lambda signature mismatch, const misuse, wrong argument count.
Patterns must be tested against both clang and MSVC output, whose wording differs.
Done when
- the fifteen entries each have a fixture from real clang and MSVC output
- an unmatched error still prints usefully, with the raw text and no crash
- --raw always available
Depends on
#621
Part of #617.
Problem
A C++ compiler error is unreadable to someone who has never seen one. The track's audience may not know what a compiler is, and the first chapter deliberately makes them read an error. Handing them 40 lines of template instantiation backtrace ends the session.
What to build
modules/ErrorHints.lua: a table of {pattern, explanation, pointer} matched against compiler stderr. The plain sentence prints first, the raw error only under --raw.
Around fifteen entries to start: unknown identifier, missing include, no member named, no matching function for a template call, incomplete type, missing semicolon, undefined reference at link time, lambda signature mismatch, const misuse, wrong argument count.
Patterns must be tested against both clang and MSVC output, whose wording differs.
Done when
Depends on
#621