Behaviour since last week

0 votes
asked May 28 in Bug by kjw

HI 

Using a macro that worked last week to insert !define parameters  but is now generating syntax errors

!define DRAW(x) !define x

'====DRAW Specific Diagrams by Comment/Uncommenting Line===
'====Only uncomment one line at a Time======================
'DRAW(PART1)
DRAW(PART2)
'DRAW(PART3)

 

I have tried several scripts all unaltered since last week on https://www.planttext.com/

But the syntax error persists

Wondered if there has been a release over the weekend ?

1 Answer

0 votes
answered May 28 by plantuml (200,240 points)

Yes, we release an important version this week-end that slightly changes the preprocessor behaviour.

See http://plantuml.com/preprocessing

Even if this should have no impact on most diagrams, some might be impacted, especially when doing high usage of the preprocessor :-)

It's difficult to solve your issue without having your full diagram, but I think you should now use:

@startuml
!unquoted function DRAW($x) return %set_variable_value($x, 1)

'====DRAW Specific Diagrams by Comment/Uncommenting Line===
'====Only uncomment one line at a Time======================
'DRAW(PART1)
DRAW(PART2)
'DRAW(PART3)

!ifdef PART1
Alice -> Bob : part1
!endif
!ifdef PART2
Alice -> Bob : part2
!endif
!ifdef PART3
Alice -> Bob : part3
!endif
@enduml

Usually, we try to respect ascending compatibility. In this case, it was not possible to have a full compatibility.
But we gain a much more powerful preprocessor

Hope this helps!

commented May 28 by KJW
Thanks that solves the issue
...