File tree Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Expand file tree Collapse file tree 3 files changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1511,13 +1511,17 @@ function! s:VimLParser.parse_heredoc()
1511
1511
let node.op = words[-1 ]
1512
1512
let lines = []
1513
1513
call self .parse_trail ()
1514
- while self .reader.peek () !=# ' <EOF>'
1515
- let line = self .reader.readline ()
1514
+ while s: TRUE
1515
+ if self .reader.peek () == # ' <EOF>'
1516
+ break
1517
+ endif
1518
+ let line = self .reader.getn (-1 )
1516
1519
if line == # node.op
1517
1520
let node.str = join (lines , " \n " ) . " \n "
1518
1521
return node
1519
1522
endif
1520
1523
call add (lines , line )
1524
+ call self .reader.get ()
1521
1525
endwhile
1522
1526
return s: NIL
1523
1527
endfunction
@@ -1566,6 +1570,7 @@ function! s:VimLParser.parse_cmd_let()
1566
1570
elseif s2 == # ' =<<'
1567
1571
call self .reader.getn (len (s2))
1568
1572
call self .reader.skip_white ()
1573
+ let node.op = ' ='
1569
1574
let node.right = self .parse_heredoc ()
1570
1575
call self .add_node (node)
1571
1576
return
Original file line number Diff line number Diff line change 1
- (let a (heredoc () "EOS" "hello\n world\n")))
1
+ (let = a (heredoc () "EOS" "hello\n world\n")))
2
+ (let = a (heredoc (trim) "EOS" "\thello\nworld\n")))
Original file line number Diff line number Diff line change @@ -2,3 +2,7 @@ let a =<< EOS
2
2
hello
3
3
world
4
4
EOS
5
+ let a = << trim EOS
6
+ hello
7
+ world
8
+ EOS
You can’t perform that action at this time.
0 commit comments