You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
lint: repo-level .lint_config (TOML) with STYLE005 off by default
Reviewers asked for TOML over a custom line-based syntax. So:
- New module daslib/toml.das — full TOML 1.0 parser that reads into the
same JsonValue? tree shape produced by daslib/json. Existing json_boost
accessors (v ?? def, from_JV, etc.) work on TOML inputs unchanged.
- .lint_config is now TOML. A single [rules] table; each entry is a
bool (true = on, false = off).
- STYLE005 is off by default. Bad TOML / missing file / no [rules] /
non-bool entries → no-op, defaults stand.
- Same dispatch as before: the three [lint_macro] paths,
utils/lint/main.das (skipped under --enable whitelist mode), and the
MCP lint subtool all consult the file via daslib/lint_config.
TOML 1.0 surface: comments, basic/literal/multi-line strings with
escapes, decimal/hex/octal/binary integers with _ separators, floats
with exponent and inf/nan, booleans, datetimes (preserved as raw
RFC-3339 strings since JSON has no date type), inline + multi-line
arrays, inline tables, [section] / [a.b] dotted headers, [[a]] arrays
of tables, dotted keys. Fail-fast error via `error` out-param.
Drive-by daslang AOT C++ emitter fix (daslib/aot_cpp.das):
to_cpp_double's daslang-side override only handled finite doubles —
'{val:.17e}' formats non-finite values as the bare tokens `inf`/`nan`,
which either don't exist in C++ (inf) or resolve to <cmath>'s
double nan(const char*) overload (nan). Both bake into AOT-emitted
code and break every C++ build. Mirrored the C++-side to_cpp_double
behavior (runtime_string.cpp:526): emit ((double)INFINITY) /
((double)(-INFINITY)) / ((double)NAN) for non-finite, DBL_MIN/DBL_MAX
boundaries for the extremes. Uses self-comparison + magnitude tests
to avoid requiring math (which cascade-broke this file's match-based
type helpers under lint-mode no_infer_time_folding).
Drive-by aot_cpp.das lint cleanups surfaced once this PR's lint
covered the file (it had never been included in any prior PR's
changed-files set):
- Add explicit fallthrough returns after match blocks so lint-mode
exhaustiveness check passes without infer-time folding (das_to_cppString,
das_to_cppCTypeString, isConstRedundantForCpp).
- PERF020: drop redundant int(...) / string(...) casts on already-typed
values (tupleSize / variantSize / variantAlign / info.name).
- STYLE016: consolidate isConstRedundantForCpp's run of same-result
match arms into one OR-chain.
- STYLE010 false positives on match's `if (_)` wildcard suppressed via
// nolint:STYLE010 (the macro expands `_` to `if (true)`; rule is right
about the source shape, wrong about the macro generator).
- TOML fixture for STYLE005: per-module opt-in
'options _enable_default_off_rules = true' in
utils/lint/tests/style005_braced_terminator.das so the rule fires
for that fixture's 5 expected sites despite the new default-off.
Tests: tests/daslib/test_toml.das (42 cases — every value type,
section / dotted / AoT shapes, parse-failure paths). Existing
tests/lint/test_lint_config.das rewritten for the TOML shape (16
cases). All 60 pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments