The Monad language. Dependent types, functional programming compiled with LLVM. Hobby project. monad-lang.org
dependent-types language compiler programming-language functional-programming

diag: fix gutter/caret indentation; slow_tests: tighten and re-enable master

Diagnostic source-context rendering (Rust + Monad) had a duplicated bug: `core/src/diag.rs`'s `write_source_context` formatted the error line as `{:>3} | ...` but every other context line additionally prepended a stray literal 3-space prefix, and the caret line hardcoded a 4-space indent instead of the 6 (3-wide number + " | ") the error line's own content actually starts at. `lang/parser/diagnostic.mo` is a deliberate hand-port of `diag.rs` and inherited the identical bug. Fixed both by computing a single gutter width per diagnostic (max(3, digit count of the widest line number shown)) and applying it uniformly to every displayed line, with the caret indented by width + 3. Added precise (exact-string, not substring) regression tests in both implementations, including a case that spans a 3-to-4- digit line-number boundary. slow_tests/ cleanup, following up on this session's earlier json.mo/toml.mo/map.mo truncation-bug fixes: - `count_decls_in_file`'s floor-count tests (`I64.gt count N`) proved only "didn't truncate to near-zero", not "parsed the whole file". Replaced with `file_fully_parses`, asserting `decls_parser`'s own `remaining` field is empty. Added the missing std/map.mo case. - Moved 5 sub-millisecond use/open round-trip tests out of slow_tests/parser_file_tests.mo into a new lang/tests/ parser_roundtrip_tests.mo — they parse tiny snippets, not real files, so they belong in the fast pre-commit sweep instead. - Re-enabled 14 tests in slow_tests/typecheck_init_tests.mo and typecheck_std_tests.mo that were disabled with stale "module dependency resolution not implemented yet" comments — resolution has been implemented and in live use by every other test in both files for a while. All 14 pass. - Updated the stale decls_parser_strict doc comment in lang/parser.mo claiming json.mo/toml.mo/map.mo still don't fully parse. Verified: full corpus + slow_tests combined, 1376/1376 passing. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Tb6xkSNyx1mvQf4XRN7dky