WireFrame null pointer /syntax error with a space

0 votes
asked Dec 21, 2020 in Bug by Serge Wenger Work (13,940 points)

Hello,

I found this bug when I didn't put a frame at the first character of a line:

See on PlantUML Server

I see also that a space before a spot give a syntax error !!!

2 Answers

0 votes
answered Dec 21, 2020 by The-Lu (19,860 points)

Hello S.,

The fact is that wire is indentation sensitive;

Have a look to those examples:

 

@startwire
$foo1
 $foo2
$foo3
@endwire
@startwire
$foo1
 $foo2
 $foo3
@endwire
@startwire
$foo1
 $foo2
  $foo3
@endwire
@startwire
$foo1
$foo2
$foo3
@endwire

See documentation:

Components can be nested using indentations (like in Python) 

http://alphadoc.plantuml.com/doc/markdown/en/wire-diagram#962sxksrb6j7kgt4drtj

For spot, we can post a wanted feature to accept indentation of spot. wink

If that can help,
Regards,
Th.

commented Dec 21, 2020 by Serge Wenger Work (13,940 points)
For me it is really a bad idea to use indentation. With this kind of syntax it is a nightmare to debug.

Why not use the proposal like QA-11066?
commented Dec 21, 2020 by plantuml (250,820 points)

For me it is really a bad idea to use indentation. With this kind of syntax it is a nightmare to debug.

Well, it's really a question of taste and habits. Python is using indentation for example.

To reassure you, we will probably support both syntaxes (indentation and bracket) in final release.

But right now, we are really in incubation with these wire diagrams. So we want to try new stuffs.

We are going to do trial and error with wire. For example, we probably are going to change the use of $ with a use of % for component names (what about [ ] BTW ?)

So we want our Java code to be shorter as possible at the beginning (it's far easier to change when it's short). For the same reasons, we are not interested on crash report right now.

When we will have collected all good ideas, we will put all together. (so with both indentations and regular { } syntax).

So thanks all for your feedbacks (even the negative ones!!), please continue to test and find ideas ! :-)

commented Dec 22, 2020 by Serge Wenger Work (13,940 points)

Hello,

I add comments in http://alphadoc.plantuml.com/doc/markdown/en/wire-diagram

 (what about [ ] BTW ?)

If it is like Nwdiag extended syntax, very good 

So we want our Java code to be shorter as possible at the beginning (it's far easier to change when it's short). For the same reasons, we are not interested on crash report right now.

I understand. Please write when we can give crash report

When we will have collected all good ideas, we will put all together. (so with both indentations and regular { } syntax).

Warning with too many syntaxes (even i don't like it :-) ) is better than many syntaxes (less code to maintain, less bug, etc.)

So thanks all for your feedbacks (even the negative ones!!), please continue to test and find ideas ! :-)

Thank you for this important and useful software. I will continue to try to make progress with remarks that are always in a positive direction.

commented Dec 22, 2020 by albert (3,000 points)
edited Jan 7 by albert

Just my 2 cents:

I fully agree with Serge Wenger Work:

For me it is really a bad idea to use indentation. With this kind of syntax it is a nightmare to debug.

The remark:

Well, it's really a question of taste and habits. Python is using indentation for example.

gives a bad example, Python code is quite incomprehensible due to the fact that the indentation is done by white-space (and leading to strange effects when mixing spaces and tabs). It is in a bit nested construct very hard to find the end of a conditional construct and therefore very hard to debug.

commented Jan 6 by awschult (260 points)
I know that I am a little late to the game here; but I agree with Serge and Albert on the indentation. I fully understand wanting to try new things. BUT CONSISTENCY IS KEY.

If you want people to continue to enjoy your product, then it has to be easy to move from one diagram to the next. All other diagrams use the {} bracket structure. Please continue to use those (unless you plan on porting the indentation scheme back to your other diagrams.).
0 votes
answered Dec 24, 2020 by plantuml (250,820 points)
We've just publish a beta http://beta.plantuml.net/plantuml.jar with new feature

http://alphadoc.plantuml.com/doc/dokuwiki/en/wire-diagram has been updated

Happy testing :-)
commented Jan 6 by Serge Wenger Work (13,940 points)

Thanks,
I continue my tests and preprocessor is not fully working (syntax error on line 5) with WireFrame:
 

 

See on PlantUML server

...