goccy / go-yaml

YAML support for the Go language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Token incorrectly identified as Integer

iliakap opened this issue · comments

commented

Describe the bug
When parsing a value that is not quoted, 1x0 is inferred to be an integer with the value 0.

To Reproduce
The following YAML demonstrates the buggy behaviour

a: 1x0

Go playground example:
https://go.dev/play/p/QNg1XLBhagK

Expected behavior
I would expect the output of the above example to be
map[a:1x0], not map[a:0]

Version Variables

  • Go version: 1.22
  • go-yaml's Version: 1.11.3 (latest)

Additional context
I tried finding any documentation of such behaviour in the yaml spec, but seems like this is a bug in the tokenizer.