Alias quote bug

0 votes
asked Dec 11, 2018 in Bug by chillin (180 points)
Hi,

I'm running into the following alias bug leading to a syntax error.

I have to use the quotes because of macro string replacements, e.g. "CUST-something", where CUST is a macro name.

Can you please fix this asap? It's very annoying as I cannot parameterize my UML and have to resort to code duplication (as temporary workaround).

@startuml

'After removing the double quotes around CUST this alias problem is gone, but I need double quotes for macro expansion

Actor "Customer" as "CUST"
"CUST" <--[#lightgreen,thickness=3]-- "CUST" : <color:blue>via Server</color>

@enduml

1 Answer

0 votes
answered Dec 12, 2018 by plantuml (294,960 points)

After removing the double quotes around CUST this alias problem is gone

The specification says that an alias does not have double quotes.
So it's not a bug, unless we change the spec (which is possible but we do have to fully understand the issue before)

I have to use the quotes because of macro string replacements, e.g. "CUST-something", where CUST is a macro name.

Maybe you can post here an example with your macro so that we better understand your issue.

For example,

@startuml
!define CUST(a) CUST##a

Actor "Customer1" as CUST(foo)
Actor "Customer2" as CUST(dummy)

CUST(foo) <--[#lightgreen]-- CUST(dummy) : <color:blue>via Server</color>
@enduml

is working fine for us.

http://www.plantuml.com/plantuml/uml/NSgn2i8m4CRn_PxYR1Sx1D6nX5Bf8rGdSOZjjGQI75oIWc-lL51n-k3x_zgOZAJi7Mn6ccmWxCxzQMkgTSlI01o7n895bsDYJx8lqCItcfYh_tpuvZ5x_wW0FXQrKfVIsVcUPY4ALwL-9TQe1tOizSrbQXPhi2TPIFHklHjeARoeUm80

Thanks!

commented Dec 13, 2018 by chillin (180 points)
I didn't know that the specification of "alias" states that no quotes are allowed. I couldn't find it in the Language Reference Guide.
Anyway, with a small modification in my code the proposed "!define CUST(a) CUST##a" works for me. I just have to remove the underscore/dash between CUST (that is replaced by the macro) and the subsequent string.
Thanks!
...