Skip to content

Commit 2decca0

Browse files
committed
refactor: remove unused code
1 parent e1cda08 commit 2decca0

1 file changed

Lines changed: 2 additions & 6 deletions

File tree

chapi-ast-c/src/main/kotlin/chapi/ast/cast/CFullIdentListener.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ open class CFullIdentListener(fileName: String, includes: MutableList<String>) :
2727
}
2828

2929
override fun enterDeclaration(ctx: CParser.DeclarationContext?) {
30-
val isTypeDef = ctx?.declarationSpecifier()?.any {
31-
it.storageClassSpecifier()?.Typedef() != null
32-
} ?: false
33-
3430
val maybeNodeName = ctx?.declarationSpecifier()?.filter {
3531
it.typeSpecifier()?.typedefName() != null
3632
}?.map {
@@ -67,8 +63,8 @@ open class CFullIdentListener(fileName: String, includes: MutableList<String>) :
6763
val specifier = typeSpec.structOrUnionSpecifier()
6864
specifier?.structOrUnion()?.text + " " + specifier?.Identifier()?.text
6965
}
70-
var value: String? = null
7166

67+
val value: String?
7268
if (type == null || type == "null null") {
7369
type = structDeclCtx.specifierQualifierList()?.typeSpecifier()?.text ?: ""
7470
value = it.structDeclarator()?.firstOrNull()?.declarator()?.text ?: ""
@@ -77,7 +73,7 @@ open class CFullIdentListener(fileName: String, includes: MutableList<String>) :
7773
}
7874

7975
val field = CodeField(
80-
TypeType = type ?: "",
76+
TypeType = type,
8177
TypeValue = value
8278
)
8379

0 commit comments

Comments
 (0)