v0.59: Added support for char literals

This commit is contained in:
Bobbi Webber-Manners 2018-05-03 10:18:17 -04:00 committed by GitHub
parent d4810980a8
commit dc5ebf741c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
13 changed files with 20 additions and 5 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
eightball

Binary file not shown.

View File

@ -1169,6 +1169,21 @@ unsigned char P()
push_operand_stack(arg);
eatspace();
} else if (*txtPtr == '\'') {
/*
* Handle character constants
*/
++txtPtr; /* Eat the ' */
arg = *txtPtr;
++txtPtr;
if (*txtPtr != '\'') {
error(ERR_NUM);
return 1;
}
++txtPtr; /* Eat the ' */
push_operand_stack(arg);
eatspace();
} else if (*txtPtr == '(') {
/*
* Handle subexpressions in parenthesis

Binary file not shown.

View File

@ -37,7 +37,7 @@
/* */
/**************************************************************************/
#define VERSIONSTR "0.58"
#define VERSIONSTR "0.59"
void print(char *str);

Binary file not shown.

BIN
test.d64

Binary file not shown.

BIN
test.dsk

Binary file not shown.

View File

@ -29,14 +29,14 @@ call expect(status)
pr.msg "Byte vars:"; pr.nl
byte b1=10;
byte b2=100;
word b3=50;
call expect((b1==10)&&(b2==100)&&(b3==50))
word b3='a';
call expect((b1==10)&&(b2==100)&&(b3=='a'))
b2=b2+10
call expect((b1==10)&&(b2==110)&&(b3==50))
call expect((b1==10)&&(b2==110)&&(b3=='a'))
b2=b1+10
call expect((b1==10)&&(b2==20)&&(b3==50))
call expect((b1==10)&&(b2==20)&&(b3=='a'))
'------------------
' Word arrays