Skip to content

fix(toml): require newlines between document statements - #7349

Open
dvd233 wants to merge 1 commit into
denoland:mainfrom
dvd233:fix/toml-document-statement-boundaries
Open

dvd233 wants to merge 1 commit into
denoland:mainfrom
dvd233:fix/toml-document-statement-boundaries

Conversation

@dvd233

@dvd233 dvd233 commented Oct 5, 2026

Copy link
Copy Markdown

Summary

Reject document statements that run into the next assignment or table header without a newline, such as a = 1 b = 2 and [table] a = 1.

A private boundary check runs after successful document-level key/value pairs and table or array-table headers, before existing whitespace/comment skipping can lose the newline evidence. It permits LF, CRLF, EOF, and trailing comments after optional spaces or tabs. Comments remain on the existing scanner path. Reusable pair/value parsers, generic repetition, the scanner, inline tables, and multiline value parsing are unchanged.

The tests cover missing separators, valid comments and line endings, EOF, multiline values, and error positions. Removing four ignore entries enables six existing fixtures under invalid/key/: after-array, after-table, after-value, no-eol-01, no-eol-03, and no-eol-04.

This addresses one document-statement separation defect tracked by #6663. It is partial progress on that issue and does not depend on #7347 or #7348.

Validation

  • Focused repository test run, including the added regressions and enabled fixtures: 650 passed / 9 failed before the parser change; 659 passed / 0 failed afterward, with 105 existing unrelated ignores.
  • Statement-only TOML tests plus docs, rerun after committing: 697 passed, 0 failed, 105 ignored.
  • A 5,012-input corpus matches Python tomllib acceptance and normalized values after the fix. Its repeated cases exercise the same separator defect and preserved behavior.
  • Repository formatting, changed-file configured lint, and offline browser-compatible entry-point typechecking passed. Two independent source reviews found no actionable defects.
  • Exact deno task ok passed in the isolated fork validation run, using the unchanged reviewed source plus a separate validation workflow: 7,504 passed (3,288 steps), 0 failed, 116 ignored.

AI assistance was used for implementation, tests, review, and this PR description.

@github-actions github-actions Bot added the toml label Oct 5, 2026
@codecov

codecov Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.04%. Comparing base (f834d02) to head (cd2920b).

Additional details and impacted files
@@           Coverage Diff            @@
##             main    #7349    +/-   ##
========================================
  Coverage   95.04%   95.04%            
========================================
  Files         619      618     -1     
  Lines       52012    51771   -241     
  Branches     9450     9405    -45     
========================================
- Hits        49434    49206   -228     
+ Misses       2031     2022     -9     
+ Partials      547      543     -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dvd233
dvd233 marked this pull request as ready for review October 5, 2026 19:08

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant