Closed Andrea-Scuderi closed 2 years ago
Hi @Andrea-Scuderi 👋, thank you for the interesting ideas and enhancements, I'd appreciate any contribution and help. If you've already prepared a PR to solve point 1, I'd be happy to review/test/merge your solution. I'll try to come up with an approach for point 2 in the following days.
@Andrea-Scuderi I've merged your PR #13, will try to follow up on an approach for point 2 in a couple of days.
Thanks! Actually there is also another nasty case, nested entities: https://docs.swift.org/swift-book/LanguageGuide/NestedTypes.html
@Andrea-Scuderi I've been doing some updates on the swift-parser and the modularity metric in general. The next release (together with your last contribution) will have some more Swift enhancements and bugfixes, stay tuned. A small teaser: 1 Swift project, 5 different graph types with different modularity.
@Andrea-Scuderi The last release 1.1.0
includes your swift enhancements with further, smaller bugfixes related to parsing and graph types. Hence I'm closing this issue. Nevertheless we still have no support for nested entities. Either we probably would have to define the pyparsing syntax in another way to match such recursive structures or find another way to extract them. This could be a more complex issue, but I'll try to think about some approach to deal with this.
@Andrea-Scuderi we could of course also work together in a follow up issue to solve this 💪?
Swift entities are the following:
class
,struct
,protocol
,enum
Swift properties can be:
var
,let
Missing implementation:
protocol
,enum
,let
example:
The class B depends from A, but the relation is not implemented in the output.
Proposed output
Consider the following valid swift example:
actual output:
desired output:
Naming
doesn't depend from other entitiesDescribing
doesn't depend from other entitiesClassA
depends onNaming
,Describing
ClassB
depends onClassA
EnumA
depends onEnumB
EnumB
depends onDescribing
StructC
depends onNaming
,Describing
,EnumA
EmergeSwiftTest
depends onClassB
,EnumB
,EnumA
,ClassA
note:
String
andUUID
are ignored in this context as they should appear as dependency on theFoundation
frameworkI've prepared a version solving the point 1. Happy to do a PR if you are interested. Not sure how to sort out point 2 though.