Prev: ED8A Up: Map Next: EDEE
EDAF: Advance Input Pointer
Used by the routines at JumpTable and ScanInputSpaces.
Jump-table target JumpTable_AdvanceInputPointer.
AdvanceInputPointer EDAF LD HL,($5BA7) Fetch *InputBuffer_TokenStart.
EDB2 LD A,(HL)
EDB3 CP $0D Return if this token is ENTER.
EDB5 RET Z
Move on to the next token.
EDB6 LD HL,($5BA9) Copy *InputBuffer_NextToken to *InputBuffer_TokenStart.
EDB9 LD ($5BA7),HL
EDBC LD A,(HL) Write *HL to *ParserState_TokenChar.
EDBD LD ($5BAB),A
EDC0 CP $0D Return if that token is ENTER.
EDC2 RET Z
Walk to the delimiter that ends this token.
AdvanceInputPointer_Scan EDC3 INC HL Jump to AdvanceInputPointer_Store if this character is ENTER.
EDC4 LD A,(HL)
EDC5 CP $0D
EDC7 JR Z,AdvanceInputPointer_Store
EDC9 CP $22 Jump to AdvanceInputPointer_Store on a quote.
EDCB JR Z,AdvanceInputPointer_Store
EDCD CP $20 Keep scanning until a space.
EDCF JR NZ,AdvanceInputPointer_Scan
AdvanceInputPointer_SkipSpaces EDD1 INC HL Skip any run of spaces.
EDD2 LD A,(HL)
EDD3 CP $20
EDD5 JR Z,AdvanceInputPointer_SkipSpaces
AdvanceInputPointer_Store EDD7 LD ($5BAC),A Write the delimiter to *ParserState_TokenDelimiter.
EDDA LD ($5BA9),HL Write HL to *InputBuffer_NextToken.
EDDD LD A,$03 Write 03 to *ParserState_MatchLength.
EDDF LD ($5BA4),A
Skip a leading "THE".
EDE2 LD HL,($5BA7) Copy *InputBuffer_TokenStart to HL.
EDE5 LD DE,$FBA4 DE=Token_THE.
EDE8 CALL CompareTokenToWord Call CompareTokenToWord.
EDEB JR NC,AdvanceInputPointer Jump to AdvanceInputPointer if "THE" was skipped.
EDED RET Return.
Prev: ED8A Up: Map Next: EDEE