Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(array test): Fail with missing separator
The toml-test generated test for an array with missing separators was failing since the parser wasn't noticing missing separators. This change leverages the zero value of `ast.Reference` (an int). The var is now declared outside the while block, and re-zeroed if the token is not a non-trailing comma. The parser checks if the previous value of `valueRef` is zero. The only time this check would pass is when the previous byte in the array was a whitespace, which would only be the case when an array is missing a separator. Resolves: part of pelletier#613
- Loading branch information