Skip to content

Commit ecde50e

Browse files
committed
compile ternary operator of is_litdict
1 parent 8d9eca0 commit ecde50e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

go/gocompiler.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -639,6 +639,8 @@ function s:GoCompiler.compile_ternary(node)
639639
let right = self.compile(a:node.right)
640640
if cond =~ '^node\.rlist\[\d\]' && left == '"nil"'
641641
return printf('func() string { if %s {return %s} else {return %s.(string)} }()', cond, left, right)
642+
elseif cond == 'is_litdict'
643+
return printf('func() *VimNode { if %s {return %s} else {return %s} }()', cond, left, right)
642644
else
643645
return printf('viml_ternary(%s, %s, %s)', cond, left, right)
644646
endif

go/vimlparser.go

Lines changed: 7 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)