CC:fix for #ifndef..., \ in string literals

This commit is contained in:
burniouf 2023-01-27 14:32:13 +01:00
parent 90dfba3e88
commit c0b3872e26
5 changed files with 27 additions and 14 deletions

Binary file not shown.

View File

@ -128,9 +128,13 @@ CORE.CompileLine
jmp DIR jmp DIR
.1 >LDA.G CC.DirState FALSE state .1 tax
>LDA.G CC.DirState FALSE state
bmi .8 bmi .8
txa
cmp #'/' cmp #'/'
bne .2 comments ... bne .2 comments ...
@ -247,8 +251,6 @@ CORE.SkipLine jsr CC.GetNextChar
cmp #C.CR cmp #C.CR
bne CORE.SkipLine bne CORE.SkipLine
jsr CC.GetNextChar
clc clc
.9 rts .9 rts

View File

@ -120,9 +120,9 @@ DIR.INCLUDE lda #0 >STZ.G PathBuf
>LDYA pData >LDYA pData
jmp FIO.FOpen jmp FIO.FOpen
*-------------------------------------- *--------------------------------------
DIR.IFDEF sec DIR.IFDEF clc
.HS 90 BCC .HS B0 BCS
DIR.IFNDEF clc DIR.IFNDEF sec
ror ZPPtr1 ror ZPPtr1
@ -136,17 +136,24 @@ DIR.IFNDEF clc
>PUSHW ZPLineBufPtr >PUSHW ZPLineBufPtr
>PUSHWI 0 ScopeID >PUSHWI 0 ScopeID
>SYSCALL SListLookup >SYSCALL SListLookup
ror ror
eor ZPPtr1 eor ZPPtr1
asl asl
>LDA.G CC.DirState >LDA.G CC.DirState
rol ror
ora #1
sta (pData),y sta (pData),y
>DEC.G CC.DirDepth >DEC.G CC.DirDepth
clc cmp #$F8
bcs .8
lda #E.OOB
sec
rts
.8 clc
rts rts
*-------------------------------------- *--------------------------------------
DIR.ELSE >LDA.G CC.DirDepth DIR.ELSE >LDA.G CC.DirDepth
@ -161,7 +168,7 @@ DIR.ELSE >LDA.G CC.DirDepth
DIR.ENDIF >LDA.G CC.DirDepth DIR.ENDIF >LDA.G CC.DirDepth
beq DIR.ESYN beq DIR.ESYN
dec inc
sta (pData),y sta (pData),y
>LDA.G CC.DirState >LDA.G CC.DirState

View File

@ -409,7 +409,7 @@ EXP.GetChar ldy ZPPtr2+1
EXP.AddConstCharP EXP.AddConstCharP
lda ZPCCConst lda ZPCCConst
ldx ZPCCConst+1 ldx ZPCCConst+1
>DEBUG
jsr CODE.LDAXI jsr CODE.LDAXI
bcs .99 bcs .99
@ -424,7 +424,6 @@ EXP.AddConstCharP
bcs .9 bcs .9
bvs .2 ESCaped bvs .2 ESCaped
* TODO : add support for \ to next line
cmp #C.CR cmp #C.CR
beq .9 beq .9
@ -440,6 +439,9 @@ EXP.AddConstCharP
.3 jsr CORE.GetNCharNBNL Skip " .3 jsr CORE.GetNCharNBNL Skip "
bcs .8 bcs .8
cmp #'\'
beq .3
cmp #'"' cmp #'"'
beq .1 beq .1

View File

@ -5,7 +5,9 @@ NEW
int main(int argc, char *argv[]) { int main(int argc, char *argv[]) {
float f1 = 99; printf("one " \
"two\n");
float f1 = 99;
float SQR=sqr(f1); float SQR=sqr(f1);
printf("f1=%e, sqr(f1)=%e\r\n", f1, SQR); printf("f1=%e, sqr(f1)=%e\r\n", f1, SQR);
getchar(); getchar();