Skip to content

Update to TOML 1.1.0#302

Merged
dduan merged 11 commits into
dduan:mainfrom
nikitabobko:bobko/toml-1.1.0
Feb 5, 2026
Merged

Update to TOML 1.1.0#302
dduan merged 11 commits into
dduan:mainfrom
nikitabobko:bobko/toml-1.1.0

Conversation

@nikitabobko

Copy link
Copy Markdown
Contributor

TOML 1.1.0 just got recently released https://github.com/toml-lang/toml/releases/tag/1.1.0. This PR updates the testData and the implementation to abide the new spec.

Feel free to do whatever you want to with the PR. If I don't satisfy your code standard, feel free to close the PR.

git log of this PR:

commit 6070f9c0b9bb84f1f8121230b9593a1d0ee7c041

    TOML 1.1.0: Support \xHH notation to basic strings for codepoints <255
    
    https://github.com/toml-lang/toml/pull/796
    
    This commit fixes all the remaining TOML 1.1.0 tests, namely:
    - [string] hex escape
    - [spec-1.1.0] common 12

commit db7f69472c08031d77239b4d538065f34b714f4e

    TOML 1.1.0: Support \e escape for the escape character
    
    https://github.com/toml-lang/toml/pull/790
    
    This commit fixes the following test:
    - [string] escape esc

commit e2b1b67d53b5f8255d37f66e6e27568f1e7b49ab

    TOML 1.1.0: Seconds in datetime and time values are now optional
    
    https://github.com/toml-lang/toml/pull/894
    
    This commit fixes the following tests:
    - [spec-1.1.0] common 34
    - [spec-1.1.0] common 29
    - [spec-1.1.0] common 31
    - [datetime] no seconds

commit e6f87cb12cf75009849771e61264e8c7eccb5bc3

    TOML 1.1.0: Allow newlines and trailing commas in inline tables
    
    https://github.com/toml-lang/toml/pull/904
    
    This commit fixes the following tests:
    - [inline-table] newline
    - [inline-table] newline comment

commit 73ed81a977fe3dd3d94f0664321c0c1120d0bc30

    Bump toml-test spec version 1.0.0 -> 1.1.0
    
    The following tests are failing now:
    
        􀢄  Test "[inline-table] newline" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  (Line 3) Syntax error: newline not allowed in inline table.
        􀢄  Test "[spec-1.1.0] common 29" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  (Line 1) Syntax error: extra chars after value.
        􀢄  Test "[string] hex escape" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  Illegal escape character 'x'.
        􀢄  Test "[spec-1.1.0] common 12" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  Illegal escape character 'x'.
        􀢄  Test "[spec-1.1.0] common 47" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  (Line 4) Syntax error: newline not allowed in inline table.
        􀢄  Test "[string] escape esc" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  Illegal escape character 'e'.
        􀢄  Test "[datetime] no seconds" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  (Line 2) Syntax error: extra chars after value.
        􀢄  Test "[spec-1.1.0] common 34" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  (Line 1) Syntax error: extra chars after value.
        􀢄  Test "[spec-1.1.0] common 31" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  (Line 1) Syntax error: extra chars after value.
        􀢄  Test "[inline-table] newline" failed after 0.014 seconds with 1 issue.
        􀢄  Test "[spec-1.1.0] common 29" failed after 0.016 seconds with 1 issue.
        􀢄  Test "[string] hex escape" failed after 0.017 seconds with 1 issue.
        􀢄  Test "[spec-1.1.0] common 12" failed after 0.017 seconds with 1 issue.
        􀢄  Test "[inline-table] newline comment" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
        􀄵  (Line 4) Syntax error: newline not allowed in inline table.
        􀢄  Test "[spec-1.1.0] common 47" failed after 0.019 seconds with 1 issue.
        􀢄  Test "[string] escape esc" failed after 0.019 seconds with 1 issue.
        􀢄  Test "[datetime] no seconds" failed after 0.021 seconds with 1 issue.
        􀢄  Test "[spec-1.1.0] common 34" failed after 0.025 seconds with 1 issue.
        􀢄  Test "[spec-1.1.0] common 31" failed after 0.026 seconds with 1 issue.
        􀢄  Test "[inline-table] newline comment" failed after 0.031 seconds with 1 issue.
        􀢄  Suite TOMLValidationTests failed after 0.041 seconds with 10 issues.
        􀢄  Test run with 743 tests in 8 suites failed after 0.550 seconds with 10 issues.
    
    I will fix the tests in the next couple of commits

commit 0f4fb654977c2a98142ffa81f83d28eadfc60e08

    Bump toml-test
    
    None of the tests are failing after the bump

commit a990f46c2addbb49c8d06c323d527cfe08359b7f

    Prefactoring: get rid of magic constant 8
    
    This prefactoring will be important in later commits when I add support
    for optional seconds (TOML 1.1.0) cause it won't longer be constant 8
    but either 8 or 5 (depending on wheter the seconds are presented or not)
    
    The magic constant 8 comes from scanTime where in case of success (not
    nil value is returned) the total increment to the index variable equals
    to 8

commit bc052d52930eadd3fc2ddbdab1a30d5df048185b

    Fix file name mistake in the header of Generated swift files
    
    The file is called Scripts/generate-tests.py not
    Scripts/sync_compliance_tests.py

@nikitabobko nikitabobko force-pushed the bobko/toml-1.1.0 branch 2 times, most recently from 6cd9aaf to 90840dd Compare February 4, 2026 17:13
@dduan

dduan commented Feb 4, 2026

Copy link
Copy Markdown
Owner

Hi, @nikitabobko, thanks for contributing! Would you mind running Scripts/format.sh . and commit the resulting changes?

@nikitabobko

Copy link
Copy Markdown
Contributor Author

Hi @dduan,

I've run Scripts/format.sh . as suggested and committed it as the first commit (hence the force push)

@nikitabobko

Copy link
Copy Markdown
Contributor Author

Oooh, it appears that the code generated by ./Scripts/generate-code.sh now conflicts with ./Scripts/format.sh

I will take a look at it tomorrow (probably, I will include the generated code to the exception list for the formatter)

@dduan

dduan commented Feb 4, 2026

Copy link
Copy Markdown
Owner

No worries.

I'm also enabling more checks for PRs at #303. If you rebase later, it should get the CI checks going.

Appreciate your help!

@nikitabobko nikitabobko force-pushed the bobko/toml-1.1.0 branch 2 times, most recently from 6ef51b5 to b410207 Compare February 5, 2026 13:40
This commit is a result of `./Scripts/format.sh`
The file is called Scripts/generate-tests.py not
Scripts/sync_compliance_tests.py
This prefactoring will be important in later commits when I add support
for optional seconds (TOML 1.1.0) cause it won't longer be constant 8
but either 8 or 5 (depending on wheter the seconds are presented or not)

The magic constant 8 comes from scanTime where in case of success (not
nil value is returned) the total increment to the index variable equals
to 8
None of the tests are failing after the bump
The following tests are failing now:

    􀢄  Test "[inline-table] newline" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  (Line 3) Syntax error: newline not allowed in inline table.
    􀢄  Test "[spec-1.1.0] common 29" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  (Line 1) Syntax error: extra chars after value.
    􀢄  Test "[string] hex escape" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  Illegal escape character 'x'.
    􀢄  Test "[spec-1.1.0] common 12" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  Illegal escape character 'x'.
    􀢄  Test "[spec-1.1.0] common 47" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  (Line 4) Syntax error: newline not allowed in inline table.
    􀢄  Test "[string] escape esc" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  Illegal escape character 'e'.
    􀢄  Test "[datetime] no seconds" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  (Line 2) Syntax error: extra chars after value.
    􀢄  Test "[spec-1.1.0] common 34" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  (Line 1) Syntax error: extra chars after value.
    􀢄  Test "[spec-1.1.0] common 31" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  (Line 1) Syntax error: extra chars after value.
    􀢄  Test "[inline-table] newline" failed after 0.014 seconds with 1 issue.
    􀢄  Test "[spec-1.1.0] common 29" failed after 0.016 seconds with 1 issue.
    􀢄  Test "[string] hex escape" failed after 0.017 seconds with 1 issue.
    􀢄  Test "[spec-1.1.0] common 12" failed after 0.017 seconds with 1 issue.
    􀢄  Test "[inline-table] newline comment" recorded an issue at TOMLComplianceSupport.swift:34:25: Issue recorded
    􀄵  (Line 4) Syntax error: newline not allowed in inline table.
    􀢄  Test "[spec-1.1.0] common 47" failed after 0.019 seconds with 1 issue.
    􀢄  Test "[string] escape esc" failed after 0.019 seconds with 1 issue.
    􀢄  Test "[datetime] no seconds" failed after 0.021 seconds with 1 issue.
    􀢄  Test "[spec-1.1.0] common 34" failed after 0.025 seconds with 1 issue.
    􀢄  Test "[spec-1.1.0] common 31" failed after 0.026 seconds with 1 issue.
    􀢄  Test "[inline-table] newline comment" failed after 0.031 seconds with 1 issue.
    􀢄  Suite TOMLValidationTests failed after 0.041 seconds with 10 issues.
    􀢄  Test run with 743 tests in 8 suites failed after 0.550 seconds with 10 issues.

I will fix the tests in the next couple of commits
@nikitabobko

Copy link
Copy Markdown
Contributor Author

I've updated the code generator to match the formatting of ./Scripts/format.sh and reformatted the code

toml-lang/toml#904

This commit fixes the following tests:
- [inline-table] newline
- [inline-table] newline comment
toml-lang/toml#894

This commit fixes the following tests:
- [spec-1.1.0] common 34
- [spec-1.1.0] common 29
- [spec-1.1.0] common 31
- [datetime] no seconds
toml-lang/toml#790

This commit fixes the following test:
- [string] escape esc
toml-lang/toml#796

This commit fixes all the remaining TOML 1.1.0 tests, namely:
- [string] hex escape
- [spec-1.1.0] common 12
@dduan dduan merged commit 71aa77e into dduan:main Feb 5, 2026
14 of 16 checks passed
@dduan

dduan commented Feb 5, 2026

Copy link
Copy Markdown
Owner

Looks great! Thanks, @nikitabobko !

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