VariantParser: Fix reading negated identifiers, replace inf_neg with -inf#101618
Merged
Conversation
inf_neg with -inf
c9d23f3 to
4d75c92
Compare
Contributor
|
Thanks! |
Contributor
|
the |
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.
This PR is a subset of PR #100414 that fixes VariantParser to allow for reading negative identifiers in
.tscnfiles, and also changes the serialization of negative infinity frominf_negto just-inf. In the current master, the code assumes that anything starting with-is a finite number.To test this PR, I made a new project with a Node3D and gave it a tool script like this:
Note: The reason I previously did not have this change separated out is because I wanted to go straight from
inf_negto-INFinstead of going through-inffirst, but it seems PR #100414 was a bit too much to review in one go.Note: We should also cherry-pick most of these changes to older Godot versions, except for the
inf_negwriting change, so that older versions can read new files saved with-inf, but the old versions should keep writinginf_negto match older patch releases in those minor versions. However, this is not vital since-infis a very rare value to serialize to a.tscnfile, especially because it is currently not possible to read or write such values in the editor inspector.