Skip to content

Leading zeros in exponent lead to parsing exception #395

@mvistein-dlr

Description

@mvistein-dlr

The parser used for parsing JSON documents does not allow the exponent of a number to have leading zeros.

We can currently correctly parse 2.0e+1, but not 2.0e+01.

According to https://www.json.org/json-en.html numbers themselves are not allowed to have leading zeroes, the exponent however is not restricted in that way.

In

fragment EXP : [Ee] [+\-]? INT ; // \- since - means "range" inside [...]

however it is specified that the exponent must be INT. Maybe [0-9]+ would be better?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions