jirutka/rsql-parser

Allowing reserved character in selector ?

ajitnain opened this issue · 1 comments

Currently reserved character are not allowed in selector. In one of my use case selector contains reserved characters.

  1. Is there any way to handle this.
  2. What was the reason for not allowing reserved character in selector. I think it could have been handled like arguments i.e. if reserved characters in selector then it can be quoted.

Thanks

Seems that changing Selector() in RSQLParser.jj from

String Selector(): {}
{
    token = <UNRESERVED_STR>
    {
        return token.image;
    }
}

to

String Selector(): {}
{
    token = <UNRESERVED_STR> { return token.image; }
    |
    ( token = <DOUBLE_QUOTED_STR> | token = <SINGLE_QUOTED_STR> )
    {
        return unescape(token.image.substring(1, token.image.length() -1));
    }
}

Addresses the issue.

Still not sure why they are excluded in the first place!