New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Allman brace style #99

Open
evandrocoan opened this Issue Feb 12, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@evandrocoan

evandrocoan commented Feb 12, 2018

If I use Allman brace style: https://en.wikipedia.org/wiki/Indentation_style

@startuml
scale 750 width

package foo1 <<Node>>
{
    class Class1
}
@enduml

I got error when building:

Rendering [(<PlantUmlDiagrams.diagram.plantuml.PlantUMLProcessor object at 0x05F347D0>, ['@startuml\nscale 750 width\n\npackage foo1 <<Node>>\n{\n    class Class1\n}\n@enduml\n'])]
Rendering diagram for block: '@startuml\nscale 750 width\n\npackage foo1 <<Node>>\n{\n    class Class1\n}\n@enduml\n'
chdir to: F:\SublimeText\Data\Packages\PlantUmlDiagrams\samples
Error Processing Diagram:
@startuml
scale 750 width

package foo1 <<Node>>
{
    class Class1
}
@enduml

Only K&R works:

@startuml
scale 750 width

package foo1 <<Node>> {
    class Class1
}
@enduml

image

@marius63

This comment has been minimized.

marius63 commented May 25, 2018

This issue should be top priority RIGHT NOW.
Unless this is solved there's no way PlantUML can be considered "serious."
It's a pity because there is so much potential and traction.
If someone would point me to the syntactical component or class I'll have a try. (The source code directory names are cryptical, and there's no architecture, and it is not clear if the "master" is sourceforge or github, and all these are important issues on their own, but of secundary importance relative to this.)

@arnaudroques

This comment has been minimized.

Contributor

arnaudroques commented May 26, 2018

Ok, since this seems important for many people, we have started to implement this.
Due to internal way of parsing texts in PlantUML (massive use of regex), it's not that easy to do.
However, we have find a way that needs some delicate refactoring.
So with last beta http://beta.plantuml.net/plantuml.jar the first example is now working:

@startuml
scale 750 width

package foo1 <<Node>>
{
    class Class1
}
@enduml

We are going to extend this, but we need to do our refactoring first.
Please be patient, we'll post a message here (in a couple of week) when this will be ready.

@marius63

This comment has been minimized.

marius63 commented May 28, 2018

Outstanding!
This single change allows us to continue to use plantUML.
/* Word of advice: regex sucks at "massive use" and language parsing. Consider replacing it with a dedicated hand made state machine, like compilers do. Since you are refactoring... But first setup a test set if you have not already done so. */

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment