goccy / go-yaml

YAML support for the Go language
MIT License
1.12k stars 129 forks source link

Token incorrectly identified as Integer #435

Open iliakap opened 5 months ago

iliakap commented 5 months ago

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

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