Skip to content

Commit

Permalink
Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Dec 30, 2024
1 parent 363f3fd commit 85c2db9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,6 @@ object UnknownLanguage : Language<Nothing>() {
override val fileExtensions: List<String>
get() = listOf()

override val namespaceDelimiter: String
get() = "."

override val frontend: KClass<out Nothing> = Nothing::class
override val builtInTypes: Map<String, Type> = mapOf()
override val compoundAssignmentOperators: Set<String> = setOf()
Expand All @@ -423,7 +420,6 @@ object UnknownLanguage : Language<Nothing>() {
*/
object NoLanguage : Language<Nothing>() {
override val fileExtensions = listOf<String>()
override val namespaceDelimiter: String = "."
override val frontend: KClass<out Nothing> = Nothing::class
override val builtInTypes: Map<String, Type> = mapOf()
override val compoundAssignmentOperators: Set<String> = setOf()
Expand All @@ -436,7 +432,6 @@ object NoLanguage : Language<Nothing>() {
*/
class MultipleLanguages(val languages: Set<Language<*>>) : Language<Nothing>() {
override val fileExtensions = languages.flatMap { it.fileExtensions }
override val namespaceDelimiter: String = "."
override val frontend: KClass<out Nothing> = Nothing::class
override val builtInTypes: Map<String, Type> = mapOf()
override val compoundAssignmentOperators: Set<String> = setOf()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ open class BinaryOperator :
override var operatorCode: String? = null
set(value) {
field = value
if ((operatorCode in language.compoundAssignmentOperators) || (operatorCode in language.simpleAssignmentOperators)) {
if (
(operatorCode in language.compoundAssignmentOperators) ||
(operatorCode in language.simpleAssignmentOperators)
) {
throw TranslationException(
"Creating a BinaryOperator with an assignment operator code is not allowed. The class AssignExpression must be used instead."

Check warning on line 75 in cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/BinaryOperator.kt

View check run for this annotation

Codecov / codecov/patch

cpg-core/src/main/kotlin/de/fraunhofer/aisec/cpg/graph/statements/expressions/BinaryOperator.kt#L75

Added line #L75 was not covered by tests
)
Expand Down

0 comments on commit 85c2db9

Please sign in to comment.