Skip to content

Allow newlines and trailing comma in inline tables#200

Merged
hukkin merged 7 commits intomasterfrom
ml-inline-table
Jan 10, 2026
Merged

Allow newlines and trailing comma in inline tables#200
hukkin merged 7 commits intomasterfrom
ml-inline-table

Conversation

@hukkin
Copy link
Owner

@hukkin hukkin commented Aug 4, 2022

Update tests and merge when toml-lang/toml#904 makes it into a TOML release.

@mcarans mcarans mentioned this pull request Oct 25, 2022
2 tasks
@hukkin hukkin marked this pull request as ready for review December 21, 2025 10:51
Copy link

@StanFromIreland StanFromIreland left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gpshead pushed a commit to gpshead/tomli that referenced this pull request Dec 22, 2025
This adds new functions `loads_with_info()` and `load_with_info()` that
return a `ParseResult` containing:
- `data`: The parsed TOML data (same as before)
- `spec_version`: Minimum TOML spec version required ("1.0" or "1.1")
- `features`: Set of TOML 1.1 features used in the document

Currently detects the `\e` escape sequence (merged in PR hukkin#201) as a
TOML 1.1 feature. TODO comments mark where detection should be added
for pending TOML 1.1 features:
- `\xHH` hex escape (PR hukkin#202)
- Newlines/trailing commas in inline tables (PR hukkin#200)
- Optional seconds in datetime/time (PR hukkin#203)

The existing `loads()` and `load()` functions remain unchanged for
backward compatibility.

New public exports:
- `loads_with_info()`, `load_with_info()`: Parse with version info
- `ParseResult`: Frozen dataclass with parsing results
- `TOMLFeature`: Constants for TOML 1.1 feature identifiers

Addresses: hukkin#273
@codecov
Copy link

codecov bot commented Jan 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (38297f8) to head (4133dde).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff            @@
##            master      #200   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            4         4           
  Lines          526       528    +2     
  Branches        97        98    +1     
=========================================
+ Hits           526       528    +2     

☔ View full report in Codecov by Sentry.
📢 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.

@hukkin hukkin merged commit 2a2aa62 into master Jan 10, 2026
40 checks passed
@hukkin hukkin deleted the ml-inline-table branch January 10, 2026 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants