@@ -111,7 +111,7 @@ function extractGoReceiverType(receiver: TreeSitterNode): string | null {
111111function handleGoTypeDecl ( node : TreeSitterNode , ctx : ExtractorOutput ) : void {
112112 for ( let i = 0 ; i < node . childCount ; i ++ ) {
113113 const spec = node . child ( i ) ;
114- if ( ! spec || spec . type !== 'type_spec' ) continue ;
114+ if ( spec ? .type !== 'type_spec' ) continue ;
115115 const nameNode = spec . childForFieldName ( 'name' ) ;
116116 const typeNode = spec . childForFieldName ( 'type' ) ;
117117 if ( ! nameNode || ! typeNode ) continue ;
@@ -213,7 +213,7 @@ function extractGoImportSpec(spec: TreeSitterNode, ctx: ExtractorOutput): void {
213213function handleGoConstDecl ( node : TreeSitterNode , ctx : ExtractorOutput ) : void {
214214 for ( let i = 0 ; i < node . childCount ; i ++ ) {
215215 const spec = node . child ( i ) ;
216- if ( ! spec || spec . type !== 'const_spec' ) continue ;
216+ if ( spec ? .type !== 'const_spec' ) continue ;
217217 const constName = spec . childForFieldName ( 'name' ) ;
218218 if ( constName ) {
219219 ctx . definitions . push ( {
@@ -288,7 +288,7 @@ function inferAddressOfComposite(
288288) : boolean {
289289 if ( rhs . type !== 'unary_expression' ) return false ;
290290 const operand = rhs . childForFieldName ( 'operand' ) ;
291- if ( ! operand || operand . type !== 'composite_literal' ) return false ;
291+ if ( operand ? .type !== 'composite_literal' ) return false ;
292292 const typeNode = operand . childForFieldName ( 'type' ) ;
293293 if ( ! typeNode ) return false ;
294294 const typeName = extractGoTypeName ( typeNode ) ;
@@ -409,7 +409,7 @@ function extractGoParameters(paramListNode: TreeSitterNode | null): SubDeclarati
409409 if ( ! paramListNode ) return params ;
410410 for ( let i = 0 ; i < paramListNode . childCount ; i ++ ) {
411411 const param = paramListNode . child ( i ) ;
412- if ( ! param || param . type !== 'parameter_declaration' ) continue ;
412+ if ( param ? .type !== 'parameter_declaration' ) continue ;
413413 // A parameter_declaration may have multiple identifiers (e.g., `a, b int`)
414414 for ( let j = 0 ; j < param . childCount ; j ++ ) {
415415 const child = param . child ( j ) ;
@@ -494,7 +494,7 @@ function extractStructFields(structTypeNode: TreeSitterNode): SubDeclaration[] {
494494 if ( ! fieldList ) return fields ;
495495 for ( let i = 0 ; i < fieldList . childCount ; i ++ ) {
496496 const field = fieldList . child ( i ) ;
497- if ( ! field || field . type !== 'field_declaration' ) continue ;
497+ if ( field ? .type !== 'field_declaration' ) continue ;
498498 const nameNode = field . childForFieldName ( 'name' ) ;
499499 if ( nameNode ) {
500500 fields . push ( { name : nameNode . text , kind : 'property' , line : field . startPosition . row + 1 } ) ;
0 commit comments