Don't syntax highlight 1.4.0 as a float#1182
Merged
datho7561 merged 1 commit intoredhat-developer:mainfrom Dec 12, 2025
Merged
Conversation
Modify the TextMate grammar so that it doesn't count `1.4.0` as a floating point number. The current regular expression was taken from the YAML 1.1 spec, but the regular expression contradicts the examples and explanation and was likely an error. The new regular expression was taken from the YAML 1.2.2 spec. Notably, I believe that `1.4.0` is treated as a string in 1.1 and 1.2 YAML deserializers. It doesn't seem like we'll be able to upstream this change into TextMate, given there's an existing upstream PR to make this change that hasn't been merged. Fixes redhat-developer#901 Signed-off-by: David Thompson <davthomp@redhat.com>
Contributor
Author
|
@CanePlayz if you are able to, do you mind testing this PR? If not, maybe I'll just merge. |
4 tasks
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.
What does this PR do?
Modify the TextMate grammar so that it doesn't count
1.4.0as a floating point number. The current regular expression was taken from the YAML 1.1 spec, but the regular expression contradicts the examples and explanation and was likely an error. The new regular expression was taken from the YAML 1.2.2 spec. Notably, I believe that1.4.0is treated as a string in 1.1 and 1.2 YAML deserializers.It doesn't seem like we'll be able to upstream this change into TextMate, given there's an existing upstream PR to make this change that hasn't been merged.
What issues does this PR fix or reference?
Fixes #901
Is it tested? How?
Manually, by creating and opening the file in the referenced issue.
23.200should be highlighted as a float, and1.4.0should be highlighted as a string.