@@ -326,10 +326,10 @@ function mt:lookIntoChild(action, topNode, outNode)
326326 self :lookIntoBlock (action , actionStart , topNode :copy ())
327327 local lastAssign = self :getLastAssign (action .start , action .finish )
328328 if lastAssign then
329- local node = self :getNode (lastAssign )
330- if node then
331- topNode = node : copy ()
332- end
329+ self :getNode (lastAssign )
330+ end
331+ if self . nodes [ action ] then
332+ topNode = self . nodes [ action ]: copy ()
333333 end
334334 end
335335 elseif action .type == ' while' then
@@ -344,10 +344,10 @@ function mt:lookIntoChild(action, topNode, outNode)
344344 self :lookIntoBlock (action , action .keyword [4 ], blockNode :copy ())
345345 local lastAssign = self :getLastAssign (action .start , action .finish )
346346 if lastAssign then
347- local node = self :getNode (lastAssign )
348- if node then
349- topNode = mainNode : merge ( node )
350- end
347+ self :getNode (lastAssign )
348+ end
349+ if self . nodes [ action ] then
350+ topNode = mainNode : merge ( self . nodes [ action ])
351351 end
352352 end
353353 if action .filter then
@@ -388,11 +388,11 @@ function mt:lookIntoChild(action, topNode, outNode)
388388 else
389389 local lastAssign = self :getLastAssign (subBlock .start , subBlock .finish )
390390 if lastAssign then
391- local node = self :getNode (lastAssign )
392- if node then
393- blockNodes [ # blockNodes + 1 ] = node
394- mergedNode = true
395- end
391+ self :getNode (lastAssign )
392+ end
393+ if self . nodes [ subBlock ] then
394+ blockNodes [ # blockNodes + 1 ] = self . nodes [ subBlock ]
395+ mergedNode = true
396396 end
397397 end
398398 end
@@ -461,10 +461,11 @@ function mt:lookIntoBlock(block, start, node)
461461 node = self :lookIntoChild (action , node )
462462 end
463463 if action .finish > start and self .assignMap [action ] then
464- break
464+ return
465465 end
466466 :: CONTINUE::
467467 end
468+ self .nodes [block ] = node
468469end
469470
470471--- @param source parser.object
0 commit comments