chroma
chroma copied to clipboard
YAML values like `.inf` and `.nan` should be highlighted as number
Describe the bug
YAML's infinity .inf
is currently highlighted like a string, while it is technically a number so should be highlighted as such. See this and this for all possible "float" types of YAML, which could all be highlighted as number. The second page also lists this regexp:
[-+]?([0-9][0-9_]*)?\.[0-9.]*([eE][-+][0-9]+)? (base 10)
|[-+]?[0-9][0-9_]*(:[0-5]?[0-9])+\.[0-9_]* (base 60)
|[-+]?\.(inf|Inf|INF) # (infinity)
|\.(nan|NaN|NAN) # (not a number)
To Reproduce
https://swapoff.org/chroma/playground/#eyJsYW5ndWFnZSI6IllBTUwiLCJzdHlsZSI6ImRyYWN1bGEiLCJ0ZXh0IjoiYTogc3RyaW5nXG5iOiAxXG5jOiAtMVxuZDogLmluZlxuZTogLS5pbmZcblxuIiwiY2xhc3NlcyI6ZmFsc2V9
