[idl_parser] Add kTokenNumericConstant token (#6432)
authorVladimir Glavnyy <31897320+vglavnyy@users.noreply.github.com>
Thu, 11 Mar 2021 19:12:06 +0000 (02:12 +0700)
committerGitHub <noreply@github.com>
Thu, 11 Mar 2021 19:12:06 +0000 (11:12 -0800)
commit0e453ac3524100e7d78481d75e44ad3515dde0c1
tree078e7db556fca14a761a4e54c52371273ba3e3c2
parente9b4ae69dc2c5acb60691fbaf8c9ccedd45763e6
[idl_parser] Add kTokenNumericConstant token (#6432)

* [idl_parser] Add kTokenNumericConstant token

This commit adds the new token for correct parsing of signed numeric constants.
Before this expressions `-nan` or `-inf` were treated as kTokenStringConstant.
This was ambiguous if a real string field parsed.
For example, `{ "text_field" : -name }` was accepted by the parser as valid JSON object.

Related oss-fuzz issue: 6200301176619008

* Add additional positive tests fo 'inf' and 'nan' as identifiers

* Rebase to HEAD

* Move processing of signed constants to ParseSingleValue method.

* Add missed `--cpp-static-reflection` (#6324) to pass CI

* Remove `flatbuffers.pc` from repository to unblock CI (#6455).

Probably the generated flatbuffers.pc should not be a part of repo.

* Fix FieldIdentifierTest()
src/idl_parser.cpp
tests/test.cpp