diff --git a/basic/scripts/__pycache__/tokeniser.cpython-311.pyc b/basic/scripts/__pycache__/tokeniser.cpython-311.pyc index a2d19959e..bc09b8483 100644 Binary files a/basic/scripts/__pycache__/tokeniser.cpython-311.pyc and b/basic/scripts/__pycache__/tokeniser.cpython-311.pyc differ diff --git a/basic/sources/editing/tokenise/helpers/tokio.asm b/basic/sources/editing/tokenise/helpers/tokio.asm index 394f78c1a..8c544cd79 100644 --- a/basic/sources/editing/tokenise/helpers/tokio.asm +++ b/basic/sources/editing/tokenise/helpers/tokio.asm @@ -83,23 +83,42 @@ _TEILoop: bcc _TEIEndMainID jsr TOKGetNext ; get and consume jsr TOKToUpper ; capitalise it and add it - jsr _TEIAddChar + jsr TEIAddChar bra _TEILoop _TEIEndMainID: cmp #"$" ; do we have a string ? bne _TEINotString - jsr _TEIAddChar ; add it + jsr TEIAddChar ; add it jsr TOKGetNext ; consume $ jsr TOKGet ; get next _TEINotString: cmp #"(" ; do we have an array ? bne _TEINotArray - jsr _TEIAddChar ; add ( + jsr TEIAddChar ; add ( jsr TOKGetNext ; consume ( _TEINotArray: rts -_TEIAddChar: +; ************************************************************************************************ +; +; Extract sequence of digits into the tokElement buffer +; +; ************************************************************************************************ + +TOKExtractDigits: + stz tokElement +_TEDLoop: + jsr TOKGet ; get next, check end of token text + beq _TEDEndDigits ; end of line + jsr TOKIsDigit ; check digit + bcc _TEDEndDigits + jsr TOKGetNext ; get and consume and add + jsr TEIAddChar + bra _TEDLoop +_TEDEndDigits: + rts + +TEIAddChar: inc tokElement ; add it. ldx tokElement sta tokElement,x diff --git a/basic/sources/editing/tokenise/workers/tok_intconstant.asm b/basic/sources/editing/tokenise/workers/tok_intconstant.asm index 730a497e7..528ec08da 100644 --- a/basic/sources/editing/tokenise/workers/tok_intconstant.asm +++ b/basic/sources/editing/tokenise/workers/tok_intconstant.asm @@ -20,8 +20,7 @@ ; ************************************************************************************************ TokeniseIntConst: - jsr TOKExtractIdentifier ; extract an identifier into the tokElement Buffer - + jsr TOKExtractDigits ; extract an identifier into the tokElement Buffer lda #tokElement & $FF ; set up to convert it. sta ControlParameters+4 lda #tokElement >> 8 diff --git a/basic/test.bsc b/basic/test.bsc index 2e4e26d6b..4c4810b3e 100644 --- a/basic/test.bsc +++ b/basic/test.bsc @@ -1,19 +1 @@ -0 ' library line -0 ' another library line -rect 10,10 solid ink 2 to 100,100 to 110,120 to 130,440 to 140,500 -edit -cls -for i = 0 to 100 -for j = 0 to 100 - doke $FF04,i:doke $FF06,j:poke $FF08,c - call send.message(5,39) - c = (c + 1) & $FF -next -next -end - -proc send.message(g,f) - while peek($FF00):wend - poke $FF01,f:poke $FF00,g - while peek($FF00):wend -endproc \ No newline at end of file +10 print 1.2