BUG in preprocessor V2 nesting ?

0 votes
asked May 1, 2019 in Bug by anonymous

source:

@startuml 
!preprocessorV2

!unquoted function $msg($type,$sub)
!if ($type == "A")
!if ($sub == "X")
A -> B: AX
!endif
!if ($sub == "Y")
A -> B: AY
!endif
!endif
!if ($type == "B")
!if ($sub == "X")
A -> B: BX
!endif
!if ($sub == "Y")
A -> B: BY
!endif
!endif

!endfunction


!unquoted function $msg2($type,$sub)
!if ($type == "A")  && ($sub == "X")
A -> B: AX
!endif
!if ($type == "A")  && ($sub == "Y")
A -> B: AY
!endif

!if ($type == "B")  && ($sub == "X")
A -> B: BX
!endif
!if ($type == "B")  && ($sub == "Y")
A -> B: BY
!endif
!endfunction

$msg(A,X)
$msg(B,Y)
A -> B: type 2
$msg2(A,X)
$msg2(B,Y)

@enduml
output:
AX
BX
AY
BY
type2
AX
BY

1 Answer

0 votes
answered May 1, 2019 by plantuml (295,000 points)

Many thanks for the feedback.

This should be fixed in last beta (beta12)  http://beta.plantuml.net/plantuml.jar

However, there may be some other bugs when using nested level of !if / !elseif / !endif so please do not hesitate to post again

...