Understand behavioral differences in the Go implementation
mainWhile the Go version is a port of the TypeScript implementation, there are key behavioral differences to note when parsing:
Number + Text Tokenization
In TypeScript, an input like 123abc is split into a number (123) and text (abc). In Go, this is treated as a single text token ("123abc") and is not recognized as a number.
Empty and Whitespace Input
- Exact empty string (
""): Both implementations short-circuit immediately. - Whitespace or comments only: Both implementations process these through the normal parse flow, which resolves to
null(TypeScript) ornil(Go) based on grammar rules.