Skip to content

Commit dcd14c4

Browse files
committed
refactor(ast): rename variable for clarity in ProtobufFullIdentListener.kt #31
Update the variable name from 'child' to 'enumChild' to improve readability in the context of processing enum elements within the ProtobufFullIdentListener. This change reduces confusion by differentiating the variable's role in the enum-specific branch of the when-statement.
1 parent 67e8578 commit dcd14c4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

chapi-ast-protobuf/src/main/kotlin/chapi/ast/protobuf/ProtobufFullIdentListener.kt

+3-3
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ class ProtobufFullIdentListener(var fileName: String) : Protobuf3BaseListener()
9494
)
9595

9696
child.enumBody().enumElement().map {
97-
when (val child = it.getChild(0)) {
97+
when (val enumChild = it.getChild(0)) {
9898
is Protobuf3Parser.OptionStatementContext -> {
9999
enumDs.Fields += CodeField(
100100

@@ -104,8 +104,8 @@ class ProtobufFullIdentListener(var fileName: String) : Protobuf3BaseListener()
104104
is Protobuf3Parser.EnumFieldContext -> {
105105
enumDs.Fields += CodeField(
106106
TypeType = name,
107-
TypeKey = child.ident().text,
108-
TypeValue = child.intLit().text
107+
TypeKey = enumChild.ident().text,
108+
TypeValue = enumChild.intLit().text
109109
)
110110
}
111111
}

0 commit comments

Comments
 (0)