From 93b3c2410a61a6fafde9ce39c94c82352f8ef8b0 Mon Sep 17 00:00:00 2001 From: Jim Grace Date: Mon, 26 Feb 2024 12:34:22 -0500 Subject: [PATCH 1/2] feat: contains and containsItems [DHIS2-16211] --- pom.xml | 2 +- .../org/hisp/dhis/parser/expression/antlr/Expression.g4 | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 402d4d7..5265159 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ jar DHIS Antlr Expression Parser org.hisp.dhis.parser - 1.0.35 + 1.0.36-SNAPSHOT Antlr Expression Parser diff --git a/src/main/antlr4/org/hisp/dhis/parser/expression/antlr/Expression.g4 b/src/main/antlr4/org/hisp/dhis/parser/expression/antlr/Expression.g4 index 5d99cd2..ddf1dc2 100644 --- a/src/main/antlr4/org/hisp/dhis/parser/expression/antlr/Expression.g4 +++ b/src/main/antlr4/org/hisp/dhis/parser/expression/antlr/Expression.g4 @@ -47,6 +47,8 @@ expr // Functions (alphabetical) + | it='contains(' expr (',' expr )+ ')' + | it='containsItems(' expr (',' expr )+ ')' | it='firstNonNull(' expr (',' expr )* ')' | it='greatest(' expr (',' expr )* ')' | it='if(' expr ',' expr ',' expr ')' @@ -64,7 +66,6 @@ expr | it='orgUnit.program(' WS* UID WS* (',' WS* UID WS* )* ')' | it='removeZeros(' expr ')' | it='subExpression(' expr ')' - | it='textContains(' expr (',' expr )+ ')' // Aggergation functions (alphabetical) @@ -292,6 +293,8 @@ VERTICAL_BAR_2 : '||'; // Functions (alphabetical) +CONTAINS : 'contains('; +CONTAINS_ITEMS : 'containsItems('; FIRST_NON_NULL : 'firstNonNull('; GREATEST : 'greatest('; IF : 'if('; @@ -309,7 +312,6 @@ ORGUNIT_GROUP : 'orgUnit.group('; ORGUNIT_PROGRAM : 'orgUnit.program('; REMOVE_ZEROS : 'removeZeros('; SUB_EXPRESSION : 'subExpression('; -TEXT_CONTAINS : 'textContains('; // Aggegation functions (alphabetical) From bb7ab9262f57ba6ddd7a64bf0581750962a2a1f6 Mon Sep 17 00:00:00 2001 From: Jim Grace Date: Tue, 27 Feb 2024 10:19:42 -0500 Subject: [PATCH 2/2] chore: bump version to 1.0.36 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 5265159..34041c1 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ jar DHIS Antlr Expression Parser org.hisp.dhis.parser - 1.0.36-SNAPSHOT + 1.0.36 Antlr Expression Parser