Repository navigation
Conversation
TIME wrote the secfrac group as (\\.[0-9]+)? inside a Rust raw string, which is backslash-backslash-dot, so the emitted regex meant a literal backslash followed by any character. DATE_TIME four lines above has \. and is correct. Consequences both ways. A valid RFC3339 full-time is rejected: "15:30:00Z" -> True "15:30:00.000Z" -> False and a string that cannot occur in JSON at all is accepted, because an unescaped backslash is not legal there: "12:34:56\\X789" -> True This regex compiles to the DFA that constrains generation, so a model asked for format: time cannot emit fractional seconds. Fixing it flipped an existing assertion. "15:30:00.000" was listed as should-not-match with the comment // missing Z, but (Z)? is optional by design, which lines 44-45 state for DATE_TIME. The old expectation encoded the bug, so that case moves to should-match in both the TIME and the nested TIME block.
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.
No open issue covers this. Found while reading
TIMEagainstDATE_TIME.types.rs:55writes the secfrac group as(\\.[0-9]+)?inside a Rust raw string, so the emitted regex is a literal backslash followed by any character.DATE_TIMEon line 52 has\.and is correct. Four lines apart, one character different.It cuts both ways. A valid RFC3339 full-time is rejected, and a string that cannot occur in JSON at all is accepted, because an unescaped backslash is not legal there:
This compiles to the DFA that constrains generation, so a model asked for
format: timecannot emit fractional seconds.Flagging a behaviour change, because this is not only a typo fix. Applying it flipped an existing assertion:
"15:30:00.000"was listed as should-not-match with the comment// missing Z, but(Z)?is optional by design, which lines 44-45 state forDATE_TIME. The old expectation encoded the bug, so that case moves to should-match in both theTIMEand the nestedTIMEblock.Baseline on
116a7c3is the same 37. Revertingtypes.rsand keeping the test gives36 passed; 1 failed, withValue should match, but does not, in unreachable for: "15:30:00.000Z".cargo fmt --checkandcargo clippy --all-targets -- -D warningsboth exit 0, andpytest tests/gives45 passed, 2 skipped.I did not run the
asvbenchmarks or build for a non-x86_64 target.Related and not fixed here:
TIMEstill accepts onlyZ, not a numeric offset. That is what #257 fixed fordate-timelast month and it was not carried across. Happy to fold it in if you want the two together.@RobinPicard you merged #257. Is the offset worth the same pass?