bafolts / plantcode

Provides a javascript utility to generate code in various languages given a plantuml class diagram.
https://segmentationfaults.com/plantcode
MIT License
217 stars 42 forks source link

Does dot accept numbers on field/method names #7

Closed carlosasj closed 8 years ago

carlosasj commented 8 years ago

When I tried to compile with any number on the field or method names, it shows a message like this:

> plantcode $ ./plantcode -l java ../../project/classes.puml
Error parsing input file: 
SyntaxError: Expected [ \t], [(], [A-Za-z], [\n] or [\r\n] but "2" found.

This compiles:

@startuml
class Dummy {
    -String field
    #int field
    -int method()
    +void method()
}
@enduml

this too (note the number inside the type):

@startuml
class Dummy {
    -String field
    #Cli2ent field
    -int method()
    +void method()
}
@enduml

This doesn't compile:

@startuml
class Dummy {
    -String field1
    #int field2
    -int method1()
    +void method2()
}
@enduml

@Edit Underscore _ generates the same error @EndEdit

bafolts commented 8 years ago

This should be easy to address. I will get to this within the week.

bafolts commented 8 years ago

@carlosasj this issue should be resolved. I updated the tests for your case.

https://github.com/bafolts/plantuml-code-generator/blob/master/tests/car.java

Thanks for pointing out the issue.