Skip to content
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

Closed
evandrocoan opened this issue Feb 12, 2018 · 4 comments
Closed

Support Allman brace style #99

evandrocoan opened this issue Feb 12, 2018 · 4 comments

Comments

@evandrocoan
Copy link

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
Copy link

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
Copy link
Contributor

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
Copy link

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. */

@The-Lum
Copy link
Collaborator

The-Lum commented Jan 14, 2023

Hi all,

[This is an Issue Review]
This is now fixed.

Regards.

@The-Lum The-Lum closed this as completed Jan 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants