Extract enum field declarations

This commit is contained in:
Tamas Vajk
2022-04-14 14:59:07 +02:00
committed by Ian Lynagh
parent d6cbcdc847
commit b5c8d29e40
2 changed files with 15 additions and 0 deletions

View File

@@ -830,6 +830,15 @@ open class KotlinFileExtractor(
tw.writeFieldsKotlinType(id, type.kotlinResult.id) tw.writeFieldsKotlinType(id, type.kotlinResult.id)
val locId = tw.getLocation(ee) val locId = tw.getLocation(ee)
tw.writeHasLocation(id, locId) tw.writeHasLocation(id, locId)
if (!isExternalDeclaration(ee)) {
val fieldDeclarationId = tw.getFreshIdLabel<DbFielddecl>()
tw.writeFielddecls(fieldDeclarationId, parentId)
tw.writeFieldDeclaredIn(id, fieldDeclarationId, 0)
tw.writeHasLocation(fieldDeclarationId, locId)
extractTypeAccess(type, locId, fieldDeclarationId, 0)
}
} }
} }
} }

View File

@@ -87,6 +87,12 @@ A.kt:
# 23| -3: [TypeAccess] Unit # 23| -3: [TypeAccess] Unit
# 23| 0: [TypeAccess] Enu # 23| 0: [TypeAccess] Enu
# 23| 1: [BlockStmt] { ... } # 23| 1: [BlockStmt] { ... }
# 24| 4: [FieldDeclaration] Enu A;
# 24| -1: [TypeAccess] Enu
# 24| 5: [FieldDeclaration] Enu B;
# 24| -1: [TypeAccess] Enu
# 24| 6: [FieldDeclaration] Enu C;
# 24| -1: [TypeAccess] Enu
B.java: B.java:
# 0| [CompilationUnit] B # 0| [CompilationUnit] B
# 1| 1: [Class] B # 1| 1: [Class] B