Skip to content

Commit

Permalink
Merge aecbdca into 0857e2e
Browse files Browse the repository at this point in the history
  • Loading branch information
Enteee committed Feb 25, 2020
2 parents 0857e2e + aecbdca commit 6f8f708
Show file tree
Hide file tree
Showing 6 changed files with 157 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/plantuml.pegjs
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,11 @@ Note
}

NoteOf
= "of "i _ elementName:ElementReference
= "of "i _ elementName:ElementReference "::"i memberName:MemberReference
{
return elementName.name + "::" + memberName.name;
}
/ "of "i _ elementName:ElementReference
{
return elementName.name;
}
Expand Down Expand Up @@ -509,6 +513,15 @@ ElementReference
}
}

MemberReference
= name:Name
{
return {
name: name,
type: 'Unknown',
}
}

ElementName
= title:QuotedString _ "as "i _ name:Name
{
Expand Down
9 changes: 9 additions & 0 deletions test/fixtures/class-note-on-member/in.plantuml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@startuml
class Alice <<single>> {
+ cry(): any
}
note left of Alice::cry
Untype. She does
not like types.
end note
@enduml
24 changes: 24 additions & 0 deletions test/fixtures/class-note-on-member/parse-out.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[
{
"elements": [
{
"name": "Alice",
"title": "Alice",
"isAbstract": false,
"members": [
{
"name": "cry",
"isStatic": false,
"accessor": "+",
"returnType": "void",
"_arguments": ""
}
]
},
{
"text": "Untype. She does\nnot like types.",
"of": "Alice::cry"
}
]
}
]
22 changes: 22 additions & 0 deletions test/fixtures/class-note-on-member/parse-out.graph
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"nodes": [
{
"name": "Alice",
"title": "Alice",
"isAbstract": false,
"members": [
{
"name": "cry",
"isStatic": false,
"accessor": "+",
"returnType": "void",
"_arguments": ""
}
],
"id": "Alice",
"type": "Class",
"hidden": true
}
],
"edges": []
}
29 changes: 29 additions & 0 deletions test/fixtures/class-note-on-member/parseFile-out.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
[
{
"name": "test/fixtures/class-note-on-member/in.plantuml",
"diagrams": [
{
"elements": [
{
"name": "Alice",
"title": "Alice",
"isAbstract": false,
"members": [
{
"name": "cry",
"isStatic": false,
"accessor": "+",
"returnType": "void",
"_arguments": ""
}
]
},
{
"text": "Untype. She does\nnot like types.",
"of": "Alice::cry"
}
]
}
]
}
]
59 changes: 59 additions & 0 deletions test/fixtures/class-note-on-member/parseFile-out.graph
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
"nodes": [
{
"name": "test/fixtures/class-note-on-member/in.plantuml",
"diagrams": [
{
"elements": [
{
"name": "Alice",
"title": "Alice",
"isAbstract": false,
"members": [
{
"name": "cry",
"isStatic": false,
"accessor": "+",
"returnType": "void",
"_arguments": ""
}
]
},
{
"text": "Untype. She does\nnot like types.",
"of": "Alice::cry"
}
]
}
],
"id": "test/fixtures/class-note-on-member/in.plantuml",
"type": "File",
"hidden": true
},
{
"name": "Alice",
"title": "Alice",
"isAbstract": false,
"members": [
{
"name": "cry",
"isStatic": false,
"accessor": "+",
"returnType": "void",
"_arguments": ""
}
],
"id": "Alice",
"type": "Class",
"hidden": true
}
],
"edges": [
{
"from": "test/fixtures/class-note-on-member/in.plantuml",
"to": "Alice",
"name": "contains",
"hidden": true
}
]
}

0 comments on commit 6f8f708

Please sign in to comment.