File tree Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Expand file tree Collapse file tree 3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -3237,8 +3237,14 @@ function! s:ExprParser.parse_expr9()
32373237 let savepos = self .reader.tell ()
32383238 let nodepos = token.pos
32393239 let token = self .tokenizer.get ()
3240- let token2 = self .tokenizer.peek ()
3241- if token.type == s: TOKEN_ARROW || token2.type == s: TOKEN_ARROW || token2.type == s: TOKEN_COMMA
3240+ let lambda = token.type == s: TOKEN_ARROW
3241+ if ! lambda && ! (token.type == s: TOKEN_SQUOTE || token.type == s: TOKEN_DQUOTE )
3242+ " if the token type is stirng, we cannot peek next token and we can
3243+ " assume it's not lambda.
3244+ let token2 = self .tokenizer.peek ()
3245+ let lambda = token2.type == s: TOKEN_ARROW || token2.type == s: TOKEN_COMMA
3246+ endif
3247+ if lambda
32423248 " lambda {token,...} {->...} {token->...}
32433249 let node = s: Node (s: NODE_LAMBDA )
32443250 let node.pos = nodepos
Original file line number Diff line number Diff line change 33(echo (dict ('1' 1)))
44(echo (dict (1 1)))
55(echo (dict (x 1)))
6+ (echo (dict ("\<cr>" 1)))
7+ (echo (dict ("vim" 1)))
8+ (echo (dict ((+ 1 1) 2)))
69; XXX: echo {x:1}
Original file line number Diff line number Diff line change 33echo {' 1' : 1 }
44echo {1 : 1 }
55echo {x : 1 }
6+ echo {" \<cr> " : 1 }
7+ echo {" vim" : 1 }
8+ echo {1 + 1 :2 }
69" XXX: echo {x:1}
7-
You can’t perform that action at this time.
0 commit comments