speed up line tokeniser for common cases
This commit is contained in:
1 parent
fd612be221
commit
fd46b9314c
1 file changed
+20
@@ -66,7 +66,21 @@ tokenise_char_loop:
|
|||||||
jmp tk_literal_char
|
jmp tk_literal_char
|
||||||
|
|
||||||
tk_not_quote:
|
tk_not_quote:
|
||||||
|
;; Check for literal characters in various ranges
|
||||||
|
;; (This just speeds the tokeniser up, by avoiding the packed token search
|
||||||
|
;; for such characters).
|
||||||
|
|
||||||
|
;; SPACE and punctuation before +,- and *
|
||||||
|
cmp #$2a
|
||||||
|
bcc tk_literal_char
|
||||||
|
;; Digits
|
||||||
|
cmp #$30
|
||||||
|
bcc tk_might_be_keyword
|
||||||
|
cmp #$3a
|
||||||
|
bcs tk_might_be_keyword
|
||||||
|
jmp tk_literal_char
|
||||||
|
|
||||||
|
tk_might_be_keyword:
|
||||||
;; Don't tokenise in quote mode
|
;; Don't tokenise in quote mode
|
||||||
lda quote_mode_flag
|
lda quote_mode_flag
|
||||||
bne tk_literal_char
|
bne tk_literal_char
|
||||||
@@ -76,6 +90,12 @@ tk_not_quote:
|
|||||||
lda $0111
|
lda $0111
|
||||||
sta tokenise_work1
|
sta tokenise_work1
|
||||||
|
|
||||||
|
;; XXX - We should implement an optimisation where we
|
||||||
|
;; trim the last symbol of successively, instead of re-packing the word
|
||||||
|
;; again with one less char each time.
|
||||||
|
;; XXX - We should limit the word length to the length of interesting chars
|
||||||
|
;; that are available.
|
||||||
|
|
||||||
jsr pack_word
|
jsr pack_word
|
||||||
lda tokenise_work2
|
lda tokenise_work2
|
||||||
cmp #$10
|
cmp #$10
|
||||||
|
|||||||
Reference in new issue
Block a user