Make multi-line cimment delimiters (/' and '/) work on a single line

0 votes
asked Oct 19, 2015 in Wanted features by Spandex (190 points)

I'd like to see /' and '/  operate on a single line, much as the C preprocessor allows /* and */ to work on a single line. This would allow marking & commenting individual lines. For instance,

'SECTION
'NUMBER      ASSIGNMENTS     TEXT

/' 1 '/      ABC -> DEF   :  This is message 1

             GHI -> JKL   :  This is message 2

/' 2 '/      MNO => PQR   :  This is message 3

etc...

Adding inline comments could also be useed to temporarily override s dnipper of code for debgging.

autonumber /' 10 '/ 11

 I believe that this capability would be available to all disgram types.

Thanks,

-Nick

 

 

 

2 Answers

+1 vote
answered Oct 19, 2015 by plantuml (131,770 points)
Very good idea!

This has been implemented in last beta:
https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

It may not be working in some cases, so do not hesitate to give feedback.

Thanks for the suggestion!
0 votes
answered Oct 19, 2015 by Spandex (190 points)
Thanks so much for the quick turnaround.

The beta seems to treat

/' comment '/  remainder-of-line

as

/' comment reaminder of line '/

In other words, the comment goes to the end of the line.

Thanks again for such a terrific application!

-Nick
commented Oct 20, 2015 by plantuml (131,770 points)
It must depend on the context, the following example seems to work for us:

@startuml
Alice -> Bob : /' comment '/  remainder-of-line
/' comment '/ Alice -> Bob :  second message
@enduml

Could you post a complete and non-working diagram ?

Thanks!
commented Oct 20, 2015 by Spandex (190 points)
Below is an example of the non-working code. The error i get is after the 'deactivate GAMMA' statement, and it says, "Only activate command can occur before messages are sent." If I remove the /' ... '/ from the source, the code compiles and runs without error.

@startuml
   !define SEQTYPE
   
   '****************************************************************************
   '*                           Sequence Definitions                           *
   '****************************************************************************
   
   title     New Feature : Inline comment blocks

   actor    "Primary Actor" as GAMMA
   database "Supporting Actor" as DELTA
   
   '  Activate all participants
   activate GAMMA
   activate DELTA
   
   alt Main Success Scenario
   
   /' 1 '/   GAMMA -> Delta : Send the first message
   /' 2 '/   Delta -> Gamma : Send the second message

   end  /' alt / else '/
   
   '  Deactivate all participants
   deactivate GAMMA
   deactivate DELTA
   
@enduml
commented Oct 20, 2015 by plantuml (131,770 points)
Thanks for the detailed report! It really helps.

This bug has been solved in the last beta : https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

For the record, the whole block was treated as a comment:
 /' 1 '/   GAMMA -> Delta : Send the first message
   /' 2 '/   Delta -> Gamma : Send the second message
   end  /' alt / else '/

Anyway, do not hesitate to report other issues.

Thanks again,
commented Oct 20, 2015 by Spandex (190 points)
It seems to work perfectly!

Thank you so much.
-Nick
...