File tree 3 files changed +14
-3
lines changed
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()
3237
3237
let savepos = self .reader.tell ()
3238
3238
let nodepos = token.pos
3239
3239
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
3242
3248
" lambda {token,...} {->...} {token->...}
3243
3249
let node = s: Node (s: NODE_LAMBDA )
3244
3250
let node.pos = nodepos
Original file line number Diff line number Diff line change 3
3
(echo (dict ('1' 1)))
4
4
(echo (dict (1 1)))
5
5
(echo (dict (x 1)))
6
+ (echo (dict ("\<cr>" 1)))
7
+ (echo (dict ("vim" 1)))
8
+ (echo (dict ((+ 1 1) 2)))
6
9
; XXX: echo {x:1}
Original file line number Diff line number Diff line change 3
3
echo {' 1' : 1 }
4
4
echo {1 : 1 }
5
5
echo {x : 1 }
6
+ echo {" \<cr> " : 1 }
7
+ echo {" vim" : 1 }
8
+ echo {1 + 1 :2 }
6
9
" XXX: echo {x:1}
7
-
You can’t perform that action at this time.
0 commit comments