diff src/interp.s @ 126:ac183a519439

Update parsing scheme with a keyword lookup by token value and other framework Add ability to turn a token code into a keyword string. Also correct some details related to token table generation with some additiona adjustments for token symbols. Also rework token symbol definitions and creation of some parsing tables as well as the main statement parsing loop.
author William Astle <lost@l-w.ca>
date Mon, 08 Jan 2024 22:58:08 -0700
parents eb2681108660
children 9d57279c900e
line wrap: on
line diff
--- a/src/interp.s	Sun Jan 07 20:35:51 2024 -0700
+++ b/src/interp.s	Mon Jan 08 22:58:08 2024 -0700
@@ -69,13 +69,17 @@
 immediate0      jsr readline                    ; read input line
                 bcs immediate0                  ; brif ended with BREAK
                 ldx #linebuff                   ; point to start of line input buffer
-                stx inputptr                    ; set input pointer
-                jsr curchar                     ; skip spaces and set flags
-                bcs immediate1                  ; brif there's a line number
-                tsta                            ; is there anything there at all (end of line)?
-                beq immediate0                  ; brif not - read another line
-                ldx inputptr                    ; get the modified input pointer processing above
-                jsr tokenize                    ; tokenize the line at inputptr, return with result at tokebuff and X
+immediate0a     lda ,x                          ; do we have anything at all?
+                beq immediate0                  ; brif not - just read another line
+                cmpa #0x20                      ; space?
+                bne immediate0c                 ; brif not
+immediate0b     leax 1,x                        ; move past the 
+                bra immediate0a                 ; keep looking for the start of input
+immediate0c     bsr setcifdigit                 ; do we have a line number?
+                bcs immediate1                  ; brif so - go handle program editing
+                clrb                            ; flag to do actual parsing
+                jsr parse                       ; go parse the line
+                bra *
                 jsr interpretline               ; go interpret the tokenized line
                 bra immediate                   ; go handle another line
 immediate1      bsr parse_lineno                ; parse the line number