Escaping things

0 votes
asked Jul 3, 2019 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:

http://www.plantuml.com/plantuml/uml/bP11JiCm54Jt_nJJ28bssN218aGFm8BzLpm94Ovjx1zK2VNkgAdQqbAaihDcxEVHMnNJREFWPPOoKuuDIudvjHRnR0qMaVlkpU3wpCRw64HcxHYc8zhvNT212sdYa69WC5HJKicCmHtkYIHjthKZdZU9ZT7XIu1Jg4FoX1Pmivmgu1vFcdfJZpKiGZzZxy1Dqb1sHE3qlbhFgmoYO8I7LOjggaCqxiSBS2CIk6HDCOERS09iVmn_OHczGGioos5u-nkmbQt8Jf-6pXEFZOtg_rPG7nMqw6Xblz7HmR6ateYFCHhBkOJpVx6yhk5MB731g_-Xehwg0Wz76Ii6Dmx-6m00

1 Answer

0 votes
answered Jul 3, 2019 by plantuml (294,960 points)
commented Jul 4, 2019 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:

http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuL8iA4ejACfFJYqkpYyAC-BYIixFBSZFIyqhKL2giqcogxF9j4lApqbHo2n9pCbCjj7FjBFHJx9Jud98pKi16W00

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?
...