-
Notifications
You must be signed in to change notification settings - Fork 64
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
Better support for language(s) in components and result #1913
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, although, I have some comments that we should consider.
Also I am think we may want to have a NoLanguage
language, to represent a node not having any language. This notions was previously captured by the nullness that I gladly see gone here. There is a clear difference between UnknownLanugage
and NoLanguage
as UnknownLanguage
may be latter inferred. An example of nodes with not language are OverlayNodes
, and there may be more in the future. If we decide to not introduce a a NoLanguage
in this PR, which would not hinder merging IMO, we should then plan what our heuristic is to assign languages in this case: Language of an associated node that definitely has a language or a MultipleLanguages with no languages?
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/UnknownLanguage.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/BinaryOperator.kt
Outdated
Show resolved
Hide resolved
cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/frontends/UnknownLanguage.kt
Outdated
Show resolved
Hide resolved
I like the idea about |
Having different default Languages is a good idea, the more specific the better, so |
21d70b8
to
363f3fd
Compare
This PR introduces a new
UnknownLanguage
instead of makingNode.language
nullable. Furthermore, it introduces a newMultipleLanguages
language that is composed of several ones. This is used for components and translation results.Fixes #1899