Skip to content

Commit

Permalink
Fixed grammar ambiguity in CASE-WHEN
Browse files Browse the repository at this point in the history
  • Loading branch information
vpinna80 authored Oct 17, 2024
1 parent 238a0a2 commit 868ce55
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions v2.1/src/main/antlr4/org/sdmx/vtl/Vtl.g4
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ expr:
| left=expr op=AND right=expr # booleanExpr
| left=expr op=(OR|XOR) right=expr # booleanExpr
| IF conditionalExpr=expr THEN thenExpr=expr ELSE elseExpr=expr # ifExpr
| CASE (WHEN condExpr=expr THEN thenExpr=expr)+ ELSE elseExpr=expr # caseExpr
| CASE (WHEN condExpr+=expr THEN thenExpr+=expr)+ ELSE elseExpr=expr # caseExpr
| constant # constantExpr
| varID # varIdExpr

Expand All @@ -45,7 +45,7 @@ exprComponent:
| left=exprComponent op=AND right=exprComponent # booleanExprComp
| left=exprComponent op=(OR|XOR) right=exprComponent # booleanExprComp
| IF conditionalExpr=exprComponent THEN thenExpr=exprComponent ELSE elseExpr=exprComponent # ifExprComp
| CASE (WHEN condExpr=exprComponent THEN thenExpr=exprComponent)+ ELSE elseExpr=exprComponent # caseExprComp
| CASE (WHEN condExpr+=exprComponent THEN thenExpr+=exprComponent)+ ELSE elseExpr=exprComponent # caseExprComp
| constant # constantExprComp
| componentID # compId
;
Expand Down

0 comments on commit 868ce55

Please sign in to comment.