rsql-parser icon indicating copy to clipboard operation
rsql-parser copied to clipboard

Allowing reserved character in selector ?

Open ajitnain opened this issue 8 years ago • 2 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

ajitnain avatar Feb 24 '18 19:02 ajitnain

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!

mkargar avatar Jun 22 '18 15:06 mkargar