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.
Follow up to #620. Went the way of only validating UTF-8 characters as opposed to decoding them. Realized there was an opportunity by also checking against the set of invalid TOML characters (TOML doesn't allow all UTF-8 characters everywhere). This goes against the two-passes version I was thinking of initially, but it ended up being faster on my machine. There is still the option to change that validation to vectorized instructions, but that's only useful for long strings / comments (see segmentio/asm#58), which seems quite rare in TOML docs.
Also added some strings and comments parsing benchmarks. Not quite useful from a user perspective but gave much stabler signal when implementing those methods.
Compared to #620. The map benchmark is slower on that run, but when ran separately it was on par. Allocations omitted because there is no change.
Compared to base (cc0d1a9), it's much slower which is to be expected given the parser and scanner are doing a lot more work.
Fixes some of #613:
go test -tags testsuite -run TestTOMLTest_Invalid_Control_CommentDel
go test -tags testsuite -run TestTOMLTest_Invalid_Control_CommentLf
go test -tags testsuite -run TestTOMLTest_Invalid_Control_CommentNull
go test -tags testsuite -run TestTOMLTest_Invalid_Control_CommentUs
go test -tags testsuite -run TestTOMLTest_Invalid_Control_MultiDel
go test -tags testsuite -run TestTOMLTest_Invalid_Control_MultiLf
go test -tags testsuite -run TestTOMLTest_Invalid_Control_MultiNull
go test -tags testsuite -run TestTOMLTest_Invalid_Control_MultiUs
go test -tags testsuite -run TestTOMLTest_Invalid_Control_RawmultiDel
go test -tags testsuite -run TestTOMLTest_Invalid_Control_RawmultiLf
go test -tags testsuite -run TestTOMLTest_Invalid_Control_RawmultiNull
go test -tags testsuite -run TestTOMLTest_Invalid_Control_RawmultiUs
go test -tags testsuite -run TestTOMLTest_Invalid_Control_RawstringDel
go test -tags testsuite -run TestTOMLTest_Invalid_Control_RawstringLf
go test -tags testsuite -run TestTOMLTest_Invalid_Control_RawstringNull
go test -tags testsuite -run TestTOMLTest_Invalid_Control_RawstringUs
go test -tags testsuite -run TestTOMLTest_Invalid_Control_StringBs
go test -tags testsuite -run TestTOMLTest_Invalid_Control_StringDel
go test -tags testsuite -run TestTOMLTest_Invalid_Control_StringLf
go test -tags testsuite -run TestTOMLTest_Invalid_Control_StringNull
go test -tags testsuite -run TestTOMLTest_Invalid_Control_StringUs
go test -tags testsuite -run TestTOMLTest_Invalid_String_BadCodepoint
go test -tags testsuite -run TestTOMLTest_Invalid_String_BasicMultilineOutOfRangeUnicodeEscape1
go test -tags testsuite -run TestTOMLTest_Invalid_String_BasicMultilineOutOfRangeUnicodeEscape2
go test -tags testsuite -run TestTOMLTest_Invalid_String_BasicOutOfRangeUnicodeEscape1
go test -tags testsuite -run TestTOMLTest_Invalid_String_BasicOutOfRangeUnicodeEscape2
go test -tags testsuite -run TestTOMLTest_Valid_String_UnicodeEscape
go test -tags testsuite -run TestTOMLTest_Valid_String_UnicodeLiteral