@@ -355,8 +355,8 @@ protected void finalProcess(GraphTargetItem parent, List<GraphTargetItem> list,
355355 SetTargetActionItem st = (SetTargetActionItem ) it ;
356356 if (st .target .isEmpty ()) {
357357 if (targetStart > -1 ) {
358- targetEnd = t ;
359- break ;
358+ targetEnd = t ;
359+ break ;
360360 }
361361 } else {
362362 target = new DirectValueActionItem (null , null , 0 , st .target , new ArrayList <>());
@@ -378,8 +378,8 @@ protected void finalProcess(GraphTargetItem parent, List<GraphTargetItem> list,
378378 }
379379 if ((st .target instanceof DirectValueActionItem ) && st .target .getResult ().equals ("" )) {
380380 if (targetStart > -1 ) {
381- targetEnd = t ;
382- break ;
381+ targetEnd = t ;
382+ break ;
383383 }
384384 } else {
385385 targetStart = t ;
@@ -433,6 +433,8 @@ protected void finalProcess(GraphTargetItem parent, List<GraphTargetItem> list,
433433 targetStartItem = st ;
434434 target = new DirectValueActionItem (null , null , 0 , st .target , new ArrayList <>());
435435 }
436+ } else if (targetStart > -1 ) {
437+ targetEnd = t ;
436438 }
437439 }
438440 if (it instanceof SetTarget2ActionItem ) {
@@ -445,8 +447,14 @@ protected void finalProcess(GraphTargetItem parent, List<GraphTargetItem> list,
445447 targetStartItem = st ;
446448 target = st .target ;
447449 }
450+ } else if (targetStart > -1 ) {
451+ targetEnd = t ;
448452 }
449453 }
454+
455+ if (it instanceof TellTargetActionItem && targetStart > -1 ) {
456+ targetEnd = t ;
457+ }
450458
451459 if (targetStart > -1 && targetEnd > -1 ) {
452460 List <GraphTargetItem > newlist = new ArrayList <>();
@@ -459,15 +467,15 @@ protected void finalProcess(GraphTargetItem parent, List<GraphTargetItem> list,
459467 }
460468 newlist .add (new TellTargetActionItem (targetStartItem .getSrc (), targetStartItem .getLineStartItem (), target , tellist ));
461469 //TODO: maybe set nested flag
462- for (int i = targetEnd + 1 ; i < list .size (); i ++) {
470+ for (int i = targetEnd + ( it instanceof TellTargetActionItem ? 0 : 1 ) ; i < list .size (); i ++) {
463471 newlist .add (list .get (i ));
464472 }
465473 list .clear ();
466474 list .addAll (newlist );
467475 targetStart = -1 ;
468476 targetEnd = -1 ;
469477 target = null ;
470- t = 0 ;
478+ t = - 1 ;
471479 }
472480 }
473481 for (int t = 1 /*not first*/ ; t < list .size (); t ++) {
0 commit comments