Fix parsing of dotted keys inside array-of-tables#334
Merged
orchestr7 merged 2 commits intoJul 6, 2025
Conversation
rjwalters
added a commit
to rjwalters/ktoml
that referenced
this pull request
Nov 20, 2025
… headers) This commit adds comprehensive regression tests to ensure that ktoml correctly handles empty lines after TOML table headers, which is valid per TOML 1.0 spec but was reported as broken in issue orchestr7#361. ## Test Coverage **Issue361Test.kt** - JVM-specific regression tests: - testFastAPIWithEmptyLineAfterTableHeader: Reproduces the exact FastAPI pyproject.toml pattern - testMultipleEmptyLinesAfterTableHeader: Tests multiple consecutive empty lines - testEmptyLinesWithCommentsAfterTableHeader: Tests empty lines mixed with comments - testNestedTableWithEmptyLineAfterHeader: Tests deeply nested tables with empty lines **RealWorldPythonProjectTest.kt** - Cross-platform tests: - testFastAPIStyleEmptyLineAfterTableHeader: Parser-level test - testEmptyLineAfterTableHeader: Minimal reproduction - testMultipleEmptyLinesAfterTableHeader: Edge case testing ## Testing Results All tests pass on the current main branch, indicating that the issue reported in orchestr7#361 has been resolved (likely through PRs orchestr7#353, orchestr7#334, or orchestr7#333). These regression tests ensure the fix remains stable and prevent future regressions of this issue. Closes orchestr7#361 🤖 Generated with [Claude Code](https://claude.com/claude-code)
rjwalters
added a commit
to rjwalters/ktoml
that referenced
this pull request
Nov 20, 2025
… headers) This commit adds comprehensive regression tests to ensure that ktoml correctly handles empty lines after TOML table headers, which is valid per TOML 1.0 spec but was reported as broken in issue orchestr7#361. ## Test Coverage **Issue361Test.kt** - JVM-specific regression tests: - testFastAPIWithEmptyLineAfterTableHeader: Reproduces the exact FastAPI pyproject.toml pattern - testMultipleEmptyLinesAfterTableHeader: Tests multiple consecutive empty lines - testEmptyLinesWithCommentsAfterTableHeader: Tests empty lines mixed with comments - testNestedTableWithEmptyLineAfterHeader: Tests deeply nested tables with empty lines **RealWorldPythonProjectTest.kt** - Cross-platform tests: - testFastAPIStyleEmptyLineAfterTableHeader: Parser-level test - testEmptyLineAfterTableHeader: Minimal reproduction - testMultipleEmptyLinesAfterTableHeader: Edge case testing ## Testing Results All tests pass on the current main branch, indicating that the issue reported in orchestr7#361 has been resolved (likely through PRs orchestr7#353, orchestr7#334, or orchestr7#333). These regression tests ensure the fix remains stable and prevent future regressions of this issue. Closes orchestr7#361 🤖 Generated with [Claude Code](https://claude.com/claude-code)
orchestr7
pushed a commit
that referenced
this pull request
Dec 7, 2025
…#363) This commit adds comprehensive regression tests to ensure that ktoml correctly handles empty lines after TOML table headers, which is valid per TOML 1.0 spec but was reported as broken in issue #361. ## Test Coverage **Issue361Test.kt** - JVM-specific regression tests: - testFastAPIWithEmptyLineAfterTableHeader: Reproduces the exact FastAPI pyproject.toml pattern - testMultipleEmptyLinesAfterTableHeader: Tests multiple consecutive empty lines - testEmptyLinesWithCommentsAfterTableHeader: Tests empty lines mixed with comments - testNestedTableWithEmptyLineAfterHeader: Tests deeply nested tables with empty lines **RealWorldPythonProjectTest.kt** - Cross-platform tests: - testFastAPIStyleEmptyLineAfterTableHeader: Parser-level test - testEmptyLineAfterTableHeader: Minimal reproduction - testMultipleEmptyLinesAfterTableHeader: Edge case testing ## Testing Results All tests pass on the current main branch, indicating that the issue reported in #361 has been resolved (likely through PRs #353, #334, or #333). These regression tests ensure the fix remains stable and prevent future regressions of this issue.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, the parser would produce the wrong tree structure for use of
dotted.key = "value"while inside of an[[arrayOfTables]]. As an example:Before this fix, this is parsed as:
After this fix, it is now correctly parsed as:
This matches the structure that was already working when using a non-array table:
And this time, I remembered to make sure it passes lint 😄