diff --git a/src/input.c b/src/input.c index fbacfce..f9ec04f 100644 --- a/src/input.c +++ b/src/input.c @@ -16,6 +16,23 @@ #include "tree.h" +// type definitions + +// values for input_now->state +enum inputstate { + INPUTSTATE_SOF, // start of file (check for hashbang) + INPUTSTATE_NORMAL, // everything's fine + INPUTSTATE_AGAIN, // re-process last byte + INPUTSTATE_SKIPBLANKS, // shrink multiple spaces + INPUTSTATE_LF, // send start-of-line after end-of-statement + INPUTSTATE_CR, // same, but also remember to skip LF + INPUTSTATE_SKIPLF, // skip LF if that's next + INPUTSTATE_COMMENT, // skip characters until newline or EOF + INPUTSTATE_EOB, // send end-of-block after end-of-statement + INPUTSTATE_EOF, // send end-of-file after end-of-statement +}; + + // Constants const char FILE_READBINARY[] = "rb"; #define CHAR_LF (10) // line feed (in file) diff --git a/src/input.h b/src/input.h index 36bbe27..1af616a 100644 --- a/src/input.h +++ b/src/input.h @@ -13,19 +13,6 @@ // type definitions -// values for input component "src.state" (FIXME - try to move this into .c file!) -enum inputstate { - INPUTSTATE_SOF, // start of file (check for hashbang) - INPUTSTATE_NORMAL, // everything's fine - INPUTSTATE_AGAIN, // re-process last byte - INPUTSTATE_SKIPBLANKS, // shrink multiple spaces - INPUTSTATE_LF, // send start-of-line after end-of-statement - INPUTSTATE_CR, // same, but also remember to skip LF - INPUTSTATE_SKIPLF, // skip LF if that's next - INPUTSTATE_COMMENT, // skip characters until newline or EOF - INPUTSTATE_EOB, // send end-of-block after end-of-statement - INPUTSTATE_EOF, // send end-of-file after end-of-statement -}; enum inputsrc { INPUTSRC_FILE, INPUTSRC_RAM @@ -38,7 +25,7 @@ struct input { // the current code initially came from, i.e. it may change during macro execution. struct location location; // file + line (during RAM reads as well) enum inputsrc source; - enum inputstate state; // state of input + int state; // state of input (type is really "enum inputstate") union { FILE *fd; // file descriptor char *ram_ptr; // RAM read ptr (loop or macro block) diff --git a/src/version.h b/src/version.h index d41ed29..d175ce1 100644 --- a/src/version.h +++ b/src/version.h @@ -9,7 +9,7 @@ #define RELEASE "0.97" // update before release FIXME #define CODENAME "Zem" // update before release -#define CHANGE_DATE "19 Jul" // update before release FIXME +#define CHANGE_DATE "20 Jul" // update before release FIXME #define CHANGE_YEAR "2024" // update before release //#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/" #define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME