Escaping things

0 votes
asked Jul 3 in Question / help by nickolay.martinov
How can I escape a function name so it does not gets called?

I try to make a diagram that demonstrates what function will produce and try to put example of function call in rectangle title, component title and in notes but it doesn't work because function gets called. It works the same with old preprocessor and !define and with new preprocessor and !function.

Here's example:

1 Answer

0 votes
answered Jul 3 by plantuml (205,940 points)
commented Jul 4 by nickolay.martinov
Thank you for suggestion.

Solution with $ looks very nice at first but actual code to place in source starts to differ from what you provide in example. Also, none of standard libraries prefix function names with $.

Solutions with unicode symbols are clever but... will work only for functions. Global variables and legacy macros will not be escaped this way. Also, I could imagine that space between function name and open bracket could be later a valid construct.

Of course one can replace first letter of each function name with unicode symbols but this is very cumbersome.

Would be nice to have a way to prevent macro expansion. Just as you can do this currently with HTML:

As far as I remember, C preprocessor, that is inspiration for at least legacy plantuml preprocessor, does not expand inside literal strings. Instead, literal strings are kept as is. Is there any way to tell plantuml that something is a literal string and should be used as is?