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

Commit

Permalink
0.17.1
Browse files Browse the repository at this point in the history
Added #comments in order to support adding #!/usr/bin/clibasic to .bas files
  • Loading branch information
PQCraft authored Jul 30, 2021
1 parent da9558e commit 6eb3646
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions clibasic.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@

/* ------------------------ */

// Patch/Error checking defines

/* Fix implicit declaration issues */
#define _POSIX_C_SOURCE 999999L
#define _XOPEN_SOURCE 999999L
Expand All @@ -50,6 +52,8 @@
#define _WIN_NO_VT
#endif

// Needed includes

#include <math.h>
#include <time.h>
#include <stdio.h>
Expand All @@ -69,6 +73,8 @@
#include <readline/readline.h>
#include <readline/history.h>

// OS-specific includes and definitions

#ifndef _WIN32
#include <termios.h>
#include <sys/ioctl.h>
Expand All @@ -82,7 +88,9 @@
#define SIGKILL 9
#endif

char VER[] = "0.17";
// Base defines

char VER[] = "0.17.1";

#if defined(__linux__)
char OSVER[] = "Linux";
Expand Down Expand Up @@ -110,6 +118,8 @@ char VER[] = "0.17";
char BVER[] = "?";
#endif

// Global vars and functions

int progindex = -1;
char** progbuf = NULL;
char** progfn = NULL;
Expand Down Expand Up @@ -683,7 +693,7 @@ int main(int argc, char** argv) {
{cmdl++;}
if (!didloop) {cp++;} else {didloop = false;}
} else {
if (!inStr && conbuf[concp] == '\'') comment = true;
if (!inStr && (conbuf[concp] == '\'' || conbuf[concp] == '#')) comment = true;
if (conbuf[concp] == '"') {inStr = !inStr; cmdl++;} else
if ((conbuf[concp] == ':' && !inStr) || conbuf[concp] == 0) {
comment = false;
Expand Down Expand Up @@ -920,7 +930,7 @@ bool loadProg(char* filename) {
while (!feof(prog)) {
int tmpc = fgetc(prog);
if (tmpc == '"') inStr = !inStr;
if (tmpc == '\'' && !inStr) comment = true;
if (!inStr && (tmpc == '\'' || tmpc == '#')) comment = true;
if (tmpc == '\n') comment = false;
if (tmpc == '\r' || tmpc == '\t') tmpc = ' ';
if (!comment) {progbuf[progindex][j] = (char)tmpc; j++;}
Expand Down
Binary file modified docs/manual.odt
Binary file not shown.
Binary file modified docs/manual.pdf
Binary file not shown.

0 comments on commit 6eb3646

Please sign in to comment.