mirror of
https://github.com/bobbimanners/EightBall.git
synced 2024-05-28 12:41:28 +00:00
v0.59: Added support for char literals
This commit is contained in:
parent
d4810980a8
commit
dc5ebf741c
BIN
8ball20.prg
BIN
8ball20.prg
Binary file not shown.
BIN
8ball64.prg
BIN
8ball64.prg
Binary file not shown.
BIN
8ballvm20.prg
BIN
8ballvm20.prg
Binary file not shown.
BIN
8ballvm64.prg
BIN
8ballvm64.prg
Binary file not shown.
BIN
ebvm.system
BIN
ebvm.system
Binary file not shown.
15
eightball.c
15
eightball.c
|
@ -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
|
||||
|
|
BIN
eightball.system
BIN
eightball.system
Binary file not shown.
|
@ -37,7 +37,7 @@
|
|||
/* */
|
||||
/**************************************************************************/
|
||||
|
||||
#define VERSIONSTR "0.58"
|
||||
#define VERSIONSTR "0.59"
|
||||
|
||||
void print(char *str);
|
||||
|
||||
|
|
BIN
eightballvm
BIN
eightballvm
Binary file not shown.
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user