Add \xHH Unicode escape code to basic strings#796
Conversation
|
@pradyunsg Where did we land with this? It seems like a friction-free addition to the language (and one that would bring TOML in line with many other languages which also support |
|
Yea, let's do this. |
|
@eksortso Do you have time to update this PR against the current |
|
I'll update it later this evening. |
|
Awesome, thanks @eksortso |
|
@marzer I think that's got it. |
|
The second change to |
|
For some reason I'd thought this had already been taken care of. It's up to date again. @marzer @pradyunsg Care to take look at it? |
ChristianSi
left a comment
There was a problem hiding this comment.
Looks good otherwise!
|
@pradyunsg Any updates on this? Is the issue with |
|
Thanks @eksortso! ^>^ |
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
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
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
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
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
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
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
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
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
* Update the code generator to match the formatting of ./Scripts/format.sh
* Reformat the code
This commit is a result of `./Scripts/format.sh`
* 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
* 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
* Bump toml-test
None of the tests are failing after the bump
* 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
* TOML 1.1.0: Allow newlines and trailing commas in inline tables
toml-lang/toml#904
This commit fixes the following tests:
- [inline-table] newline
- [inline-table] newline comment
* TOML 1.1.0: Seconds in datetime and time values are now optional
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 1.1.0: Support \e escape for the escape character
toml-lang/toml#790
This commit fixes the following test:
- [string] escape esc
* TOML 1.1.0: Support \xHH notation to basic strings for codepoints <255
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
* Docs: Now, we fully implement TOML 1.1.0
Per a conversation in #622, this PR adds a two-character \x escape code sequence for the first 256 Unicode code points. This provides a short explicit sequence for, among other code points: ASCII characters, certain control characters, and whitespace characters such as tab (\x09) and space (\x20) that need visible representation without resorting to longer \u and \U codes. Such sequences are commonly found in languages that also support the \u and \U codes for Unicode.
This PR replaces #709 and is intended for a post-v1.0.0 version of the TOML standard.