@@ -9,44 +9,6 @@ bool conditional(struct basic_ctx* ctx) {
99 return up_conditional (ctx );
1010}
1111
12- /*
13- bool conditional(struct basic_ctx* ctx)
14- {
15- char current_line[MAX_STRINGLEN];
16- char* pos = strchr(ctx->ptr, '\n');
17- char* end = strchr(ctx->ptr, 0);
18- bool stringlike = false, real = false;
19- strlcpy(current_line, ctx->ptr, pos ? pos - ctx->ptr + 1 : end - ctx->ptr + 1);
20- for (char* n = current_line; *n && *n != '\n'; ++n) {
21- if (strlen(n) >= 2 && isalnum(*n) && *(n + 1) == '$') {
22- stringlike = true; // String variable
23- break;
24- } else if (strlen(n) >= 2 && isalnum(*n) && *(n + 1) == '#') {
25- real = true; // Real variable
26- break;
27- } else if (strlen(n) >= 3 && isdigit(*n) && *(n + 1) == '.' && isdigit(*(n + 2))) {
28- real = true; // Decimal number
29- break;
30- } else if (strlen(n) >= 5 && *n == ' ' && *(n + 1) == 'T' && *(n + 2) == 'H' && *(n + 3) == 'E' && *(n + 4) == 'N') {
31- break;
32- } else if (*n == '\n') {
33- break;
34- }
35- }
36-
37- bool r = false;
38- if (!real) {
39- int64_t ri = stringlike ? str_relation(ctx) : relation(ctx);
40- r = (ri != 0);
41- } else {
42- double rd;
43- double_relation(ctx, &rd);
44- r = (rd != 0.0);
45- }
46- return r;
47- }
48- */
49-
5012void else_statement (struct basic_ctx * ctx )
5113{
5214 /* If we get to an ELSE, this means that we executed a THEN part of a block IF,
0 commit comments