~rabbits/drifblim

5e880ad2dac81bd5e2ae18ce4f79573b61be82f9 — neauoire 6 months ago b37d37d
Formatting
1 files changed, 13 insertions(+), 7 deletions(-)

M src/drifblim.tal
M src/drifblim.tal => src/drifblim.tal +13 -7
@@ 103,8 103,9 @@
		JMP2r

@handle-char ( c -- )
	.token zkey ?{ JMP2r }
		;token/buf DUP2 parse !<sclr>
	.token zkey ?{
		JMP2r }
	;token/buf DUP2 parse !<sclr>

(
@|tokenizer )


@@ 277,7 278,8 @@
	( >> )

@<create-symbol> ( name* -- )
	.scan LDZ ?{ POP2 JMP2r }
	.scan LDZ ?{
		POP2 JMP2r }
	( not hex ) is-hex ?&invalid
	( not opc ) is-opcode ?&invalid
	( not dup ) DUP2 find-symbol INC2 ORA ?&not-unique


@@ 293,12 295,15 @@
		POP2 ;err/duplicate !<set-error>

@get-ref ( token* -- <label>* )
	LDAk [ LIT "{ ] NEQ ?{ lambda/push }
	LDAk [ LIT "{ ] NEQ ?{
		lambda/push }
	.scan LDZ ?&scan
	LDAk [ LIT "& ] NEQ ?{ INC2 make-sublabel }
	LDAk [ LIT "& ] NEQ ?{
		INC2 make-sublabel }
	find-symbol INC2k #0000 EQU2 ?{
		INC2k INC2 LDAk INC ROT ROT STA
		JMP2r } ;err/reference <set-error>
		JMP2r }
	;err/reference <set-error>
	&scan POP2 ;&fill JMP2r
	&fill ffff "? $1



@@ 332,7 337,8 @@
@is-hex ( str* -- str* f )
	DUP2
	&w ( -- )
		LDAk chex INC ?{ POP2 #00 JMP2r }
		LDAk chex INC ?{
			POP2 #00 JMP2r }
		INC2 LDAk ?&w
	POP2 #01 JMP2r