Skip to content

NumberFormatException when doing lookup with a decimal #1295

@mschoeb

Description

@mschoeb

Lookup with a decimal should not parse and result in a parser error. Currently, the xquery parser accepts any number and then fails when trying to turn it into an integer. Our parsers both do not differentiate between Integers and other numbers

The fix is to change
keySpecifier : ( in=Literal| lt=stringLiteral | nc=NCName | pe=parenthesizedExpr | vr=varRef | wc='*');
to something like
keySpecifier : ( in=IntegerLiteral| lt=stringLiteral | nc=NCName | pe=parenthesizedExpr | vr=varRef | wc='*');

But this is not straightforward as the lexer will still turn it into a Literal and the parser cant find it. Putting the IntegerLiteral lexer rule higher results in other things breaking (IntegerLiteral appearing where Literal is expected)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions