Tcl Library Source Code

Check-in [03e3d184d6]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Aug 20.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Preserve farthest-failure path for all *_branch super-instructions. Test included. Prior to this fix, three out of four *_branch si pushed an empty element to the ES, rather than the current FFP. This corresponded to i_error_clear_push, rather than the (documented and) needed i_error_push.
Timelines: family | ancestors | descendants | both | ssoberni-ffp-3ed39a451f
Files: files | file ages | folders
SHA3-256:03e3d184d66a31ca58948a83bd08a39c5fbe289485246bef1040bad0f9925570
User & Date: ssoberni 2018-06-13 13:48:47
Original Comment: Preserve farthest-failure path for all *_branch super-instructions. Test included. Prior to this fix, three out of four *_branch si pushed an empty element to the ES, rather the current FFP. This corresponded to i_error_clear_push, rather than the (documented and) needed i_error_push.
Context
2018-06-22
04:30
Brought in trunk work (mostly the doc changes) Leaf check-in: 3ec4e74aac user: aku tags: ssoberni-ffp-3ed39a451f
2018-06-13
13:48
Preserve farthest-failure path for all *_branch super-instructions. Test included. Prior to this fix, three out of four *_branch si pushed an empty element to the ES, rather than the current FFP. This corresponded to i_error_clear_push, rather than the (documented and) needed i_error_push. check-in: 03e3d184d6 user: ssoberni tags: ssoberni-ffp-3ed39a451f
13:41
Create new branch named "ssoberni-ffp-3ed39a451f" check-in: a3cdfd4c68 user: ssoberni tags: ssoberni-ffp-3ed39a451f
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to modules/pt/pt_rdengine_oo.tcl.

546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
...
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
...
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
	if {$myok} {
	    $mystackloc pop
	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackmark push [$mystackast size]
	set myloc [$mystackloc peek]
	$mystackerr push {}

	debug.pt/rdengine {[InstReturn]}
	return
    }

    method si:valuevoid_branch {} {
	debug.pt/rdengine {[Instruction si:valuevoid_branch]}
................................................................................
	if {$myok} {
	    $mystackloc pop
	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackast trim* $mark
	set myloc [$mystackloc peek]
	$mystackerr push {}

	debug.pt/rdengine {[InstReturn]}
	return
    }

    method si:valuevalue_branch {} {
	debug.pt/rdengine {[Instruction si:valuevalue_branch]}
................................................................................
	    $mystackloc pop

	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackast trim* [$mystackmark peek]
	set myloc [$mystackloc peek]
	$mystackerr push {}

	debug.pt/rdengine {[InstReturn]}
	return
    }

    # - -- --- ----- -------- ------------- ---------------------








|







 







|







 







|







546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
...
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
...
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
	if {$myok} {
	    $mystackloc pop
	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackmark push [$mystackast size]
	set myloc [$mystackloc peek]
	$mystackerr push $myerror

	debug.pt/rdengine {[InstReturn]}
	return
    }

    method si:valuevoid_branch {} {
	debug.pt/rdengine {[Instruction si:valuevoid_branch]}
................................................................................
	if {$myok} {
	    $mystackloc pop
	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackast trim* $mark
	set myloc [$mystackloc peek]
	$mystackerr push $myerror

	debug.pt/rdengine {[InstReturn]}
	return
    }

    method si:valuevalue_branch {} {
	debug.pt/rdengine {[Instruction si:valuevalue_branch]}
................................................................................
	    $mystackloc pop

	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackast trim* [$mystackmark peek]
	set myloc [$mystackloc peek]
	$mystackerr push $myerror

	debug.pt/rdengine {[InstReturn]}
	return
    }

    # - -- --- ----- -------- ------------- ---------------------

Changes to modules/pt/pt_rdengine_tcl.tcl.

534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
...
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
...
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
	if {$myok} {
	    $mystackloc pop
	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackmark push [$mystackast size]
	set myloc [$mystackloc peek]
	$mystackerr push {}

	debug.pt/rdengine {[InstReturn]}
	return
    }

    method si:valuevoid_branch {} {
	debug.pt/rdengine {[Instruction si:valuevoid_branch]}
................................................................................
	if {$myok} {
	    $mystackloc pop
	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackast trim* $mark
	set myloc [$mystackloc peek]
	$mystackerr push {}

	debug.pt/rdengine {[InstReturn]}
	return
    }

    method si:valuevalue_branch {} {
	debug.pt/rdengine {[Instruction si:valuevalue_branch]}
................................................................................
	    $mystackloc pop

	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackast trim* [$mystackmark peek]
	set myloc [$mystackloc peek]
	$mystackerr push {}

	debug.pt/rdengine {[InstReturn]}
	return
    }

    # - -- --- ----- -------- ------------- ---------------------








|







 







|







 







|







534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
...
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
...
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
	if {$myok} {
	    $mystackloc pop
	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackmark push [$mystackast size]
	set myloc [$mystackloc peek]
	$mystackerr push $myerror

	debug.pt/rdengine {[InstReturn]}
	return
    }

    method si:valuevoid_branch {} {
	debug.pt/rdengine {[Instruction si:valuevoid_branch]}
................................................................................
	if {$myok} {
	    $mystackloc pop
	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackast trim* $mark
	set myloc [$mystackloc peek]
	$mystackerr push $myerror

	debug.pt/rdengine {[InstReturn]}
	return
    }

    method si:valuevalue_branch {} {
	debug.pt/rdengine {[Instruction si:valuevalue_branch]}
................................................................................
	    $mystackloc pop

	    debug.pt/rdengine {[InstReturn]}
	    return -code return
	}
	$mystackast trim* [$mystackmark peek]
	set myloc [$mystackloc peek]
	$mystackerr push $myerror

	debug.pt/rdengine {[InstReturn]}
	return
    }

    # - -- --- ----- -------- ------------- ---------------------

Added modules/pt/tests/data/gr/def/49_ticket-3ed39a451f.































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
PEG Tiny (CmdSeq) 
 	CmdSeq 		<- Cmd SEMICOLON (Cmd SEMICOLON)*;
	Cmd 		<- Skip ((IfCmd / RepeatCmd / AssignCmd / ReadCmd / WriteCmd)) Skip;
	IfCmd 		<- 'if' Exp 'then' CmdSeq ('else' CmdSeq)? 'end';
	RepeatCmd 	<- 'repeat' CmdSeq 'until' Exp;
	AssignCmd 	<- Name ASSIGNMENT Exp;
	ReadCmd 	<- 'read' Skip Name;
	WriteCmd 	<- 'write' Skip Exp;
void:   SEMICOLON       <- Skip ';' Skip;
leaf:   ASSIGNMENT      <- Skip ':=' Skip;
	Name 		<- 'n' / 'f';
	Exp 		<- Operand Skip (('*' / '-' / '+' / '>' / '<') Operand)?;
	Operand 	<- Skip (Name / <digit>) Skip;
void:   Skip 	        <- <space>*;
END;

Added modules/pt/tests/data/gr/fail-ticket-3ed39a451f-container-res/0_tinyProg.



>
1
1 {pt::rde 60 {space {t {;}}}

Added modules/pt/tests/data/gr/fail-ticket-3ed39a451f-critcl-res/0_tinyProg.



>
1
1 {pt::rde 60 {space {t {;}}}

Added modules/pt/tests/data/gr/fail-ticket-3ed39a451f-oo-res/0_tinyProg.



>
1
1 {pt::rde 60 {space {t {;}}}

Added modules/pt/tests/data/gr/fail-ticket-3ed39a451f-snit-res/0_tinyProg.



>
1
1 {pt::rde 60 {space {t {;}}}

Added modules/pt/tests/data/gr/fail-ticket-3ed39a451f/0_tinyProg.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
n := 5;
f := 1;
repeat
  f := f * n;
  n := n - 1
until n < 1;
write f;

Added modules/pt/tests/data/gr/ok-ticket-3ed39a451f-res/0_tinyProg.



>
1
CmdSeq 0 15 {Cmd 0 5 {AssignCmd 0 5 {Name 0 0} {ASSIGNMENT 1 4} {Exp 5 5 {Operand 5 5}}}} {Cmd 8 13 {AssignCmd 8 13 {Name 8 8} {ASSIGNMENT 9 12} {Exp 13 13 {Operand 13 13}}}}

Added modules/pt/tests/data/gr/ok-ticket-3ed39a451f/0_tinyProg.















>
>
>
>
>
>
>
1
2
3
4
5
6
7
n := 5;
f := 1;
repeat
  f := f * n;
  n := n - 1
until n < 1;
write f;