@@ -452,24 +452,13 @@ function s:GoCompiler.compile_let(node)
452
452
elseif left = ~ ' ^\v(self\.(find_command_cache|cache|buf|pos|context)|toplevel.body|lhs.list|(node\.(body|attr|else_|elseif|catch|finally|pattern|end(function|if|for|try))))$' && op == ' ='
453
453
" skip initialization
454
454
return
455
- elseif left = ~ ' ^\v(node\.(list|depth))$' && op == ' ='
456
- if right == ' nil' || right == ' []interface{}{}'
457
- return
458
- endif
459
- call self .out (' %s %s %s' , left , op , right )
455
+ elseif left = ~ ' ^\v%(node\.%(r?list|default_args|body))$' && op == ' ='
456
+ call self .out (' %s %s %s' , left , op , substitute (right , ' []interface{}' , ' []*VimNode' , ' g' ))
460
457
return
461
- elseif left = ~ ' node.rlist' && op == ' ='
462
- if right == ' []interface{}{}'
463
- return
464
- endif
465
- let m = matchstr (right , ' \V[]interface{}{\zs\.\*\ze}\$' )
466
- if m != ' '
467
- call self .out (' %s = []*VimNode{%s}' , left , m )
468
- else
469
- call self .out (' %s = %s' , left , right )
470
- endif
458
+ elseif left == ' node.depth' && op == ' =' && right == ' nil'
459
+ call self .out (' %s %s %s' , left , op , ' 0' )
471
460
return
472
- elseif left = ~ ' ^\v(list|curly_parts)$' && op == ' =' && right == ' []interface{}{}'
461
+ elseif left = ~ ' ^\v(r? list|curly_parts)$' && op == ' =' && right == ' []interface{}{}'
473
462
call self .out (' var %s []*VimNode' , left )
474
463
return
475
464
elseif left == ' cmd' && op == ' =' && (right == ' nil' || right = ~ ' ^\Vmap[string]interface{}{' )
0 commit comments