Skip to content
This repository has been archived by the owner on Oct 21, 2024. It is now read-only.

Commit

Permalink
0.8.3
Browse files Browse the repository at this point in the history
Removed some unnecessary checks
Added more functions
  • Loading branch information
PQCraft authored Mar 3, 2021
1 parent 6c4d158 commit eb15fd2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 1 addition & 3 deletions clibasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include <sys/time.h>
#include <editline.h>

char VER[] = "0.8.2";
char VER[] = "0.8.3";

FILE *prog;
FILE *f[256];
Expand Down Expand Up @@ -382,10 +382,8 @@ uint8_t getVal(char* tmpinbuf, char* outbuf) {
double num2 = 0;
double num3 = 0;
int numAct;
if (inbuf[0] == '"') dt = 1;
if (debug) printf("checking for syntax error\n");
if ((isSpChar(inbuf, 0) && inbuf[0] != '-') || isSpChar(inbuf, strlen(inbuf) - 1)) {cerr = 1; return 0;}
if (inbuf[0] != '"' && (inbuf[0] == '-' && isSpChar(inbuf, 1))) {cerr = 1; return 0;}
if (debug) printf("no syntax error detected\n");
int tmpct = 0;
tmp[0][0] = 0; tmp[1][0] = 0; tmp[2][0] = 0; tmp[3][0] = '"'; tmp[3][1] = 0;
Expand Down
16 changes: 15 additions & 1 deletion functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ if (!strcmp(farg[0], "CINT")) {
sprintf(outbuf, "%d", (int)dbl);
goto fexit;
}
if (!strcmp(farg[0], "STR")) {
if (!strcmp(farg[0], "STR$")) {
cerr = 0;
ftype = 1;
if (fargct != 1) {cerr = 3; goto fexit;}
Expand All @@ -85,3 +85,17 @@ if (!strcmp(farg[0], "VAL")) {
if (ftype == 1) {cerr = 2; goto fexit;}
goto fexit;
}
if (!strcmp(farg[0], "FGC")) {
cerr = 0;
ftype = 2;
if (fargct != 0) {cerr = 3; goto fexit;}
sprintf(outbuf, "%d", (int)fgc);
goto fexit;
}
if (!strcmp(farg[0], "BGC")) {
cerr = 0;
ftype = 2;
if (fargct != 0) {cerr = 3; goto fexit;}
sprintf(outbuf, "%d", (int)fgc);
goto fexit;
}

0 comments on commit eb15fd2

Please sign in to comment.