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

Syntax for class is not recognized #67

Open
Huy-Ngo opened this issue Sep 14, 2020 · 2 comments
Open

Syntax for class is not recognized #67

Huy-Ngo opened this issue Sep 14, 2020 · 2 comments

Comments

@Huy-Ngo
Copy link

Huy-Ngo commented Sep 14, 2020

Description

  • Type: Bug

Bug

puml2code version

$ git describe --tags
v0.7.0-5-ga66c113
$ puml2code -V
0.1.0

Expected Behavior

The syntax used in PlantUML doc can be parsed.

Actual Behavior

Error:

Error: line: 3 column: 28: SyntaxError: Expected [ \t], [\n], or [\r\n] but "{" found.
    at PlantUmlToCode.generate (/home/xarvos/github/puml2code/src/index.js:86:15)
    at async execute (/home/xarvos/github/puml2code/src/cli.js:53:20)

Steps to Reproduce

  • Run npm install
  • Write a file with this code:
@startuml
skinparam classAttributeIconSize 0
class Animal <<interface>> {
    - name
    - age
    + move()
}

class Dog {
    - breed
    + bark()
}

Animal <|-- Dog
@enduml
  • Run bin/puml2code -i path/to/file.puml -l java
@jupe
Copy link
Owner

jupe commented Mar 29, 2021

parser probably doesn’t understand <<interface>> property at the moment.

@jupe
Copy link
Owner

jupe commented May 8, 2021

if you just need interface class, please use interface instead of class like this:

@startuml
skinparam classAttributeIconSize 0
interface Animal {
    - name
    - age
    + move()
}

class Dog {
    - breed
    + bark()
}

Animal <|-- Dog
@enduml

This at least works: https://app.circleci.com/pipelines/github/jupe/puml2code/330/workflows/09bee73e-6967-485e-9bb9-cadc3dd97716/jobs/1030
is there reason to use class Animal <<interface>> ?

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

2 participants