File tree Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Expand file tree Collapse file tree 3 files changed +64
-0
lines changed Original file line number Diff line number Diff line change @@ -191,6 +191,7 @@ let s:TOKEN_OR = 60
191
191
let s: TOKEN_SEMICOLON = 61
192
192
let s: TOKEN_BACKTICK = 62
193
193
let s: TOKEN_DOTDOTDOT = 63
194
+ let s: TOKEN_SHARP = 64
194
195
195
196
let s: MAX_FUNC_ARGS = 20
196
197
@@ -2486,6 +2487,9 @@ function! s:ExprTokenizer.get2()
2486
2487
elseif c == # ' :'
2487
2488
call r .seek_cur (1 )
2488
2489
return self .token (s: TOKEN_COLON , ' :' , pos)
2490
+ elseif c == # ' #'
2491
+ call r .seek_cur (1 )
2492
+ return self .token (s: TOKEN_SHARP , ' #' , pos)
2489
2493
elseif c == # ' ('
2490
2494
call r .seek_cur (1 )
2491
2495
return self .token (s: TOKEN_POPEN , ' (' , pos)
@@ -3187,6 +3191,10 @@ function! s:ExprParser.parse_expr9()
3187
3191
elseif token.type == s: TOKEN_IDENTIFIER
3188
3192
call self .reader.seek_set (pos)
3189
3193
let node = self .parse_identifier ()
3194
+ elseif 0 && (token.type == s: TOKEN_COLON || token.type == s: TOKEN_SHARP )
3195
+ " XXX: no parse error but invalid expression
3196
+ call self .reader.seek_set (pos)
3197
+ let node = self .parse_identifier ()
3190
3198
elseif token.type == s: TOKEN_LT && self .reader.peekn (4 ) == ? ' SID>'
3191
3199
call self .reader.seek_set (pos)
3192
3200
let node = self .parse_identifier ()
Original file line number Diff line number Diff line change
1
+ ; XXX: no parse error but invalid expression
2
+ (echo :)
3
+ (echo #)
4
+ (echo ::)
5
+ (echo ##)
6
+ (echo :#:#)
7
+ (echo #:#:)
8
+ (echo :foo)
9
+ (echo #bar)
10
+ (echo x:y:z)
11
+ (echo x:y:1)
12
+ (echo x:1:y)
13
+ (echo 1 :x:y)
14
+ (echo (slice x nil :))
15
+ (echo (slice x nil :y))
16
+ (echo (subscript x y:))
17
+ (echo (subscript x y:z))
18
+ (echo (subscript x #:#))
19
+ (echo (subscript x y:#))
20
+ (echo (dict ("x" :)))
21
+ ; NOTE: vim stop parse at first colon because ":" is undefined variable
22
+ (echo (dict (: :)))
23
+ ; NOTE: curly name
24
+ (echo {:})
25
+ (echo {::})
26
+ (echo {x:y})
27
+ (echo (?: 0 1 :))
28
+ (echo (?: 0 : 1))
Original file line number Diff line number Diff line change
1
+ " XXX: no parse error but invalid expression
2
+ echo :
3
+ echo #
4
+ echo ::
5
+ echo ##
6
+ echo :#:#
7
+ echo #:#:
8
+ echo :foo
9
+ echo #bar
10
+ echo x :y :z
11
+ echo x :y :1
12
+ echo x :1 :y
13
+ echo 1 :x :y
14
+ echo x [::]
15
+ echo x [::y ]
16
+ echo x [y :]
17
+ echo x [y :z]
18
+ echo x [#:#]
19
+ echo x [y :#]
20
+ echo {" x" ::}
21
+ " NOTE: vim stop parse at first colon because ":" is undefined variable
22
+ echo {: : :}
23
+ " NOTE: curly name
24
+ echo {:}
25
+ echo {::}
26
+ echo {x :y }
27
+ echo (0 ? 1 : :)
28
+ echo (0 ? : : 1 )
You can’t perform that action at this time.
0 commit comments