@@ -1211,7 +1211,7 @@ function! s:VimLParser.parse_cmd_append()
1211
1211
endfunction
1212
1212
1213
1213
function ! s: VimLParser .parse_cmd_insert ()
1214
- return self .parse_cmd_append ()
1214
+ call self .parse_cmd_append ()
1215
1215
endfunction
1216
1216
1217
1217
function ! s: VimLParser .parse_cmd_loadkeymap ()
@@ -1270,27 +1270,27 @@ function! s:VimLParser.parse_cmd_lua()
1270
1270
endfunction
1271
1271
1272
1272
function ! s: VimLParser .parse_cmd_mzscheme ()
1273
- return self .parse_cmd_lua ()
1273
+ call self .parse_cmd_lua ()
1274
1274
endfunction
1275
1275
1276
1276
function ! s: VimLParser .parse_cmd_perl ()
1277
- return self .parse_cmd_lua ()
1277
+ call self .parse_cmd_lua ()
1278
1278
endfunction
1279
1279
1280
1280
function ! s: VimLParser .parse_cmd_python ()
1281
- return self .parse_cmd_lua ()
1281
+ call self .parse_cmd_lua ()
1282
1282
endfunction
1283
1283
1284
1284
function ! s: VimLParser .parse_cmd_python3 ()
1285
- return self .parse_cmd_lua ()
1285
+ call self .parse_cmd_lua ()
1286
1286
endfunction
1287
1287
1288
1288
function ! s: VimLParser .parse_cmd_ruby ()
1289
- return self .parse_cmd_lua ()
1289
+ call self .parse_cmd_lua ()
1290
1290
endfunction
1291
1291
1292
1292
function ! s: VimLParser .parse_cmd_tcl ()
1293
- return self .parse_cmd_lua ()
1293
+ call self .parse_cmd_lua ()
1294
1294
endfunction
1295
1295
1296
1296
function ! s: VimLParser .parse_cmd_finish ()
@@ -1302,7 +1302,7 @@ endfunction
1302
1302
1303
1303
" FIXME
1304
1304
function ! s: VimLParser .parse_cmd_usercmd ()
1305
- return self .parse_cmd_common ()
1305
+ call self .parse_cmd_common ()
1306
1306
endfunction
1307
1307
1308
1308
function ! s: VimLParser .parse_cmd_function ()
@@ -1312,13 +1312,15 @@ function! s:VimLParser.parse_cmd_function()
1312
1312
" :function
1313
1313
if self .ends_excmds (self .reader.peek ())
1314
1314
call self .reader.seek_set (pos)
1315
- return self .parse_cmd_common ()
1315
+ call self .parse_cmd_common ()
1316
+ return
1316
1317
endif
1317
1318
1318
1319
" :function /pattern
1319
1320
if self .reader.peekn (1 ) == # ' /'
1320
1321
call self .reader.seek_set (pos)
1321
- return self .parse_cmd_common ()
1322
+ call self .parse_cmd_common ()
1323
+ return
1322
1324
endif
1323
1325
1324
1326
let left = self .parse_lvalue_func ()
@@ -1335,7 +1337,8 @@ function! s:VimLParser.parse_cmd_function()
1335
1337
" :function {name}
1336
1338
if self .reader.peekn (1 ) !=# ' ('
1337
1339
call self .reader.seek_set (pos)
1338
- return self .parse_cmd_common ()
1340
+ call self .parse_cmd_common ()
1341
+ return
1339
1342
endif
1340
1343
1341
1344
" :function[!] {name}([arguments]) [range] [abort] [dict] [closure]
@@ -1482,7 +1485,8 @@ function! s:VimLParser.parse_cmd_let()
1482
1485
" :let
1483
1486
if self .ends_excmds (self .reader.peek ())
1484
1487
call self .reader.seek_set (pos)
1485
- return self .parse_cmd_common ()
1488
+ call self .parse_cmd_common ()
1489
+ return
1486
1490
endif
1487
1491
1488
1492
let lhs = self .parse_letlhs ()
@@ -1493,7 +1497,8 @@ function! s:VimLParser.parse_cmd_let()
1493
1497
" :let {var-name} ..
1494
1498
if self .ends_excmds (s1) || (s2 !=# ' +=' && s2 !=# ' -=' && s2 !=# ' .=' && s1 !=# ' =' )
1495
1499
call self .reader.seek_set (pos)
1496
- return self .parse_cmd_common ()
1500
+ call self .parse_cmd_common ()
1501
+ return
1497
1502
endif
1498
1503
1499
1504
" :let left op right
@@ -4021,51 +4026,74 @@ function! s:Compiler.compile(node)
4021
4026
if a: node .type == s: NODE_TOPLEVEL
4022
4027
return self .compile_toplevel (a: node )
4023
4028
elseif a: node .type == s: NODE_COMMENT
4024
- return self .compile_comment (a: node )
4029
+ call self .compile_comment (a: node )
4030
+ return s: NIL
4025
4031
elseif a: node .type == s: NODE_EXCMD
4026
- return self .compile_excmd (a: node )
4032
+ call self .compile_excmd (a: node )
4033
+ return s: NIL
4027
4034
elseif a: node .type == s: NODE_FUNCTION
4028
- return self .compile_function (a: node )
4035
+ call self .compile_function (a: node )
4036
+ return s: NIL
4029
4037
elseif a: node .type == s: NODE_DELFUNCTION
4030
- return self .compile_delfunction (a: node )
4038
+ call self .compile_delfunction (a: node )
4039
+ return s: NIL
4031
4040
elseif a: node .type == s: NODE_RETURN
4032
- return self .compile_return (a: node )
4041
+ call self .compile_return (a: node )
4042
+ return s: NIL
4033
4043
elseif a: node .type == s: NODE_EXCALL
4034
- return self .compile_excall (a: node )
4044
+ call self .compile_excall (a: node )
4045
+ return s: NIL
4035
4046
elseif a: node .type == s: NODE_LET
4036
- return self .compile_let (a: node )
4047
+ call self .compile_let (a: node )
4048
+ return s: NIL
4037
4049
elseif a: node .type == s: NODE_UNLET
4038
- return self .compile_unlet (a: node )
4050
+ call self .compile_unlet (a: node )
4051
+ return s: NIL
4039
4052
elseif a: node .type == s: NODE_LOCKVAR
4040
- return self .compile_lockvar (a: node )
4053
+ call self .compile_lockvar (a: node )
4054
+ return s: NIL
4041
4055
elseif a: node .type == s: NODE_UNLOCKVAR
4042
- return self .compile_unlockvar (a: node )
4056
+ call self .compile_unlockvar (a: node )
4057
+ return s: NIL
4043
4058
elseif a: node .type == s: NODE_IF
4044
- return self .compile_if (a: node )
4059
+ call self .compile_if (a: node )
4060
+ return s: NIL
4045
4061
elseif a: node .type == s: NODE_WHILE
4046
- return self .compile_while (a: node )
4062
+ call self .compile_while (a: node )
4063
+ return s: NIL
4047
4064
elseif a: node .type == s: NODE_FOR
4048
- return self .compile_for (a: node )
4065
+ call self .compile_for (a: node )
4066
+ return s: NIL
4049
4067
elseif a: node .type == s: NODE_CONTINUE
4050
- return self .compile_continue (a: node )
4068
+ call self .compile_continue (a: node )
4069
+ return s: NIL
4051
4070
elseif a: node .type == s: NODE_BREAK
4052
- return self .compile_break (a: node )
4071
+ call self .compile_break (a: node )
4072
+ return s: NIL
4053
4073
elseif a: node .type == s: NODE_TRY
4054
- return self .compile_try (a: node )
4074
+ call self .compile_try (a: node )
4075
+ return s: NIL
4055
4076
elseif a: node .type == s: NODE_THROW
4056
- return self .compile_throw (a: node )
4077
+ call self .compile_throw (a: node )
4078
+ return s: NIL
4057
4079
elseif a: node .type == s: NODE_ECHO
4058
- return self .compile_echo (a: node )
4080
+ call self .compile_echo (a: node )
4081
+ return s: NIL
4059
4082
elseif a: node .type == s: NODE_ECHON
4060
- return self .compile_echon (a: node )
4083
+ call self .compile_echon (a: node )
4084
+ return s: NIL
4061
4085
elseif a: node .type == s: NODE_ECHOHL
4062
- return self .compile_echohl (a: node )
4086
+ call self .compile_echohl (a: node )
4087
+ return s: NIL
4063
4088
elseif a: node .type == s: NODE_ECHOMSG
4064
- return self .compile_echomsg (a: node )
4089
+ call self .compile_echomsg (a: node )
4090
+ return s: NIL
4065
4091
elseif a: node .type == s: NODE_ECHOERR
4066
- return self .compile_echoerr (a: node )
4092
+ call self .compile_echoerr (a: node )
4093
+ return s: NIL
4067
4094
elseif a: node .type == s: NODE_EXECUTE
4068
- return self .compile_execute (a: node )
4095
+ call self .compile_execute (a: node )
4096
+ return s: NIL
4069
4097
elseif a: node .type == s: NODE_TERNARY
4070
4098
return self .compile_ternary (a: node )
4071
4099
elseif a: node .type == s: NODE_OR
@@ -4185,6 +4213,7 @@ function! s:Compiler.compile(node)
4185
4213
else
4186
4214
throw printf (' Compiler: unknown node: %s' , string (a: node ))
4187
4215
endif
4216
+ return s: NIL
4188
4217
endfunction
4189
4218
4190
4219
function ! s: Compiler .compile_body (body)
0 commit comments