~rabbits/left

fc2eea9869761df8715bc2702f1e141662a117b3 — Devine Lu Linvega 2 months ago fcabc92
Faster file-size
2 files changed, 22 insertions(+), 11 deletions(-)

M src/left.tal
M src/manifest.tal
M src/left.tal => src/left.tal +20 -9
@@ 63,7 63,7 @@
	( name ) "Left 0a
	( details ) "A 20 "Text 20 "Editor 0a
	( author ) "By 20 "Hundred 20 "Rabbits 0a
	( date ) "15 20 "Jul 20 "2024 $1 01
	( date ) "17 20 "Jul 20 "2024 $1 01
	( > ) 83 =appicon

@manifest 07 "Left $1


@@ 1078,18 1078,16 @@
	JMP2r

@file-build ( -- )
	;filepath pstr #0a18 DEO
	;filepath <pstr>
	#0a18 DEO
	JMP2r

@file-size ( path* -- size* )
	.File/name DEO2
	#0001 .File/length DEO2
	[ LIT2r 0000 ]
	&s ( -- )
	;&b feof? ?&eof
	INC2r !&s
	&eof STH2r JMP2r
	&b $1
	#0100 .File/length DEO2
	#ff00 .File/stat DEO2
	#00 #ff04 STA
	#ff00 !shex

@file-inject ( name* -- )
	DUP2 file-is-bin? ?file-inject-binary


@@ 1580,6 1578,19 @@
(
@|stdlib )

@chex ( c -: <val> )
	[ LIT "0 ] SUB DUP #0a LTH ?&end
	#27 SUB DUP #10 LTH ?&end
	POP #ff &end JMP2r

@shex ( str* -: value* )
	[ LIT2r 0000 ]
	&>w ( `i* -- )
		( acc ) [ LITr 40 ] SFT2r
		( res ) LDAk chex [ LITr 00 ] STH
		ADD2r INC2 LDAk ?&>w
	POP2 STH2r JMP2r

@hexc ( hex -- char )
	#0f AND #0a LTHk ?{
		SUB [ LIT "a ] ADD JMP2r }

M src/manifest.tal => src/manifest.tal +2 -2
@@ 284,9 284,9 @@
	#0f AND DUP #09 GTH #27 MUL ADD #30 ADD #18 DEO
	JMP2r

@pstr ( str* -- )
@<pstr> ( str* -- )
	LDAk #18 DEO
	INC2 LDAk ?pstr
	INC2 LDAk ?<pstr>
	POP2 JMP2r

@exit ( -- )