davsclaus opened a new pull request, #26560: URL: https://github.com/apache/camel/pull/26560
Fixes https://issues.apache.org/jira/browse/CAMEL-24801 The `SIMPLE_EXP_TOKEN` in `sspt.jj` did not accept `(` and `)`, so a template such as ``` sql-stored:MYPROC(TIMESTAMP :#startDate, INTEGER ${val(1)}) ``` failed with `ParseException: Encountered " <IDENTIFIER> "${val ""`. Since `$` and `{` are in the `SPECIAL` set, the lexer fell back to matching `${val` as an `IDENTIFIER` and then choked on `(`. The evaluation side was never the problem: `InParameter`/`InOutParameter` pass the whole token to the simple language. ### Changes - `sspt.jj`: add `(` and `)` to the `SIMPLE_EXP_TOKEN` character set (generated `SSPTParserTokenManager` regenerated). This is safe with JavaCC longest-match because the token must end with `}`, so `${val(1)})` stops before the procedure's closing parenthesis. - Tests: `ParserTest` covers IN/INOUT parameters with `${val(1)}`, `${bodyAs(String)}` and a function as the last parameter; `ProducerSimpleFunctionTest` runs `${val(2)}` end-to-end against HSQLDB. - Docs: note that single-argument functions work, but comma-separated arguments and nested functions are deliberately not supported since the comma separates the procedure parameters; catalog doc mirror synced. ### Scope This is intentionally not full simple support in the template. Commas cannot be added to the token, as longest-match would turn `${a}, INTEGER ${b}` into one token. --- _Claude Code on behalf of davsclaus_ -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
