Skip to content

Conversation

@agrgr
Copy link
Contributor

@agrgr agrgr commented Aug 19, 2025

  • update grammar, support placeholders with format “?0”, “?1” etc.
  • traverse expression tree and replace placeholders with new operands using the resolved values
  • relocate interface and implementation files to solve "cannot access DSLParser" warning
  • add input context with mandatory input string and optional placeholder values
  • update ParsedExpression to return expression tree and to accept pre-compiled expressions
  • update tests

@agrgr agrgr requested review from mirzakaracic and reugn August 19, 2025 19:21
@agrgr agrgr added the enhancement New feature or request label Aug 19, 2025
@agrgr agrgr changed the title FMWK-733 Support for placeholders FMWK-733 Support placeholders Aug 19, 2025
…e traversing expr. tree instead of when parsing, add tests
*/
private static Filter getFilterOrFail(AbstractPart left, AbstractPart right, FilterOperationType type) {
validateOperands(left, right);
private static Filter getFilterOrFail(AbstractPart left, AbstractPart right, FilterOperationType type,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the method should be renamed to getFilterOrNull since if nothing matches we don't raise an error but return null.

* @return A {@link Filter} if one can be generated, otherwise {@code null}
* @throws NoApplicableFilterException if the expression structure is not supported for filtering
*/
private static Filter getFilterFromExpressionOrFail(AbstractPart exprLeft, AbstractPart exprRight,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the method should be renamed to getFilterFromExpressionOrNull since if nothing matches we don't raise an error but return null.

Copy link

@mirzakaracic mirzakaracic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple nits other than that it looks great to me.

👍

@agrgr
Copy link
Contributor Author

agrgr commented Aug 27, 2025

Added support for more complicated expressions, refactored implementation, added tests

@reugn reugn changed the title FMWK-733 Support placeholders FMWK-733 Add support for expression placeholders Aug 28, 2025
@agrgr agrgr merged commit 9dd170c into main Aug 28, 2025
5 checks passed
@agrgr agrgr deleted the FMWK-733-support-placeholders branch August 28, 2025 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants