libgraviton / rql-parser

PHP RQL parser
31 stars 15 forks source link

Lexler error. #9

Closed victorynox closed 7 years ago

victorynox commented 7 years ago

v1.0.2 The lexlet throw Exception Invalid scalar token "select" (T_OPERATOR) when I try to decode rgl string containing the name of the node rgl: Example: eq(email,select%28a23sd%2Casd%2Casd%29) eq(email,select(a23sd,asd,asd)) And throw Invalid scalar token "(" (T_OPEN_PARENTHESIS) when I try to decode rgl string with (

derrekbertrand commented 7 years ago

I think this is because it isn't designed to support nested selects. This could be added, but probably shouldn't be enabled by default, as now we're beginning to get into the realm of SQL.

mrix commented 7 years ago

Hi. Yes. That's true. You can't use operators inside eq (check the documentation). But if you really need it, please upgrade to v2 and implement your own ValueParser.

bilal-renegade commented 2 years ago

Hi Unexpected token "(" (T_OPEN_PARENTHESIS) (expected T_INTEGER|T_FLOAT|T_STRING|T_DATE) {"userId":243,"exception":"[object] (Graviton\RqlParser\Exception\SyntaxErrorException(code: 0): Unexpected token \"(\" (T_OPEN_PARENTHESIS) (expected T_INTEGER|T_FLOAT|T_STRING|T_DATE) at /graviton/rql-parser/src/TokenStream.php:86)

above throw exception when I search for like (sku, PAH-410(2))

derrekbertrand commented 2 years ago

@bilal-renegade Please create a new issue if you need help. This one is closed.

You'll want to encode any special characters, including "(" and ")" when using RQL.

See the encoding docs: https://github.com/libgraviton/rql-parser#encoding-rules