Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle closing flow sequence after explicit key
Currently after an explicit flow key '?' in a flow sequence, an immediately following closing ] is ignored by the parser: % echo '[ ? ]' | ./tests/run-parser-test-suite --flow keep +STR +DOC +SEQ [] +MAP {} =VAL : =VAL : -MAP Parse error: did not find expected ',' or ']' Line: 2 Column: 1 % echo '[ ? ] ]' | ./tests/run-parser-test-suite --flow keep +STR +DOC +SEQ [] +MAP {} =VAL : =VAL : -MAP -SEQ -DOC -STR It is read correctly by the scanner as a YAML_FLOW_SEQUENCE_END_TOKEN, and the flow_level is decreased. Then it is passed to the parser where it gets ignored. This leads to invalid YAML being accepted, and valid YAML resulting in an error. Also the flow_level is incorrectly decreased, so you can nest sequences like that without running in to the MAX_NESTING_LEVEL.
- Loading branch information