~rabbits/uxnlin

9f5b202a3f85186f1fb36e092535796942ff2350 — Devine Lu Linvega a month ago c5538e6
Catch fall-through
2 files changed, 12 insertions(+), 4 deletions(-)

M etc/example.tal
M src/uxnlin.tal
M etc/example.tal => etc/example.tal +3 -3
@@ 1,6 1,6 @@
( comment )

|00 @System     [ &vector $2 &pad      $6 &r      $2 &g     $2 &b      $2 ]
|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ]

|0000



@@ 80,11 80,11 @@

BRK

( try tailcall )
!label ( fall-through )

@label

	label-name
	label-name ( tail-call )

JMP2r


M src/uxnlin.tal => src/uxnlin.tal +9 -1
@@ 151,13 151,20 @@ JMP2r
		;static-dup print-warn2
		&no-lit

	( tail-calls )
	( tail-call )
	;token ;jmp scmp3 #00 EQU ?&no-tail
	;token/last is-opcode ?&no-tail
	;token/last LDA cilc #00 EQU ?&no-tail
		;tailcall print-warn2
		&no-tail

	( fall-through )
	;token LDA LIT "@ NEQ ?&no-fall
	;token/last LDAk LIT "! NEQ ROT ROT LDA LIT "? NEQ AND ?&no-fall
	;token INC2 ;token/last INC2 scmp #00 EQU ?&no-fall
		;fall-through print-warn2
		&no-fall

	&cleanup
	;token/last ;token/last2 scpy
	;token ;token/last scpy


@@ 417,6 424,7 @@ JMP2r
@uncalled "Uncalled $1 ( using JSR when could be calling )
@optimize "Optimize $1 ( bad design )
@tailcall "Tailcall $1 ( should be a jmi )
@fall-through "Fall-through $1 ( jumping to the next label )

( specifics )
	@inc "INC $1 @inc2 "INC2 $1