jupe / puml2code

PlantUML code generator
MIT License
104 stars 21 forks source link

Coma in type definition #52

Closed anliec closed 4 years ago

anliec commented 4 years ago

Look like the parser, does not handle coma in type name.

Example

Trying to parse:

@startuml
abstract Car {
  + map<int, int> keyValueMap
}
@enduml

Will raise the following error:

Error: line: 3 column: 11: SyntaxError: Expected [ \t], [A-Za-z_*], or [^ ,\n\r\t(){}] but "," found.
at PlantUmlToCode.generate (puml2code/src/index.js:86:15)

Possible explanation

This parser was designed for JS and so does not handle this very C++ specific feature.

Possible solution

Make the parser match < and > in the same way it can match ( and ).


I will take a look into src/parser/plantuml.pegjs and try to fix this issue and open a PR

jupe commented 4 years ago

51 fixes this