diff --git a/contrib/joe_syntax/acme.jsf b/contrib/joe_syntax/acme.jsf index cce9d51..8d6c82d 100644 --- a/contrib/joe_syntax/acme.jsf +++ b/contrib/joe_syntax/acme.jsf @@ -143,6 +143,7 @@ "!le32" pseudo "!be32" pseudo "!tx" pseudo + "!txt" pseudo "!text" pseudo "!raw" pseudo "!pet" pseudo @@ -185,6 +186,8 @@ "!rl" pseudo "!rs" pseudo "!initmem" pseudo + "!debug" pseudo + "!info" pseudo "!warn" pseudo "!error" pseudo "!serious" pseudo diff --git a/src/input.c b/src/input.c index a4c576d..f7f6f2a 100644 --- a/src/input.c +++ b/src/input.c @@ -341,12 +341,8 @@ static char GetQuotedByte(void) // Skip remainder of statement, for example on error void input_skip_remainder(void) { - while (GotByte) { - GetByte(); // Read characters until end-of-statement - } -/* FIXME - check for quotes, otherwise this might treat a quoted colon like EOS! -this has already been a bug with "!to" and "!sl" where a workaround was implemented. -fix it here, once and for all, maybe like this: + // read characters until end-of-statement, but check for quotes, + // otherwise this might treat a quoted colon like EOS! dynabuf_clear(GlobalDynaBuf); while (GotByte != CHAR_EOS) { // check for quotes @@ -357,7 +353,6 @@ fix it here, once and for all, maybe like this: GetByte(); } dynabuf_clear(GlobalDynaBuf); -*/ } // Ensure that the remainder of the current statement is empty, for example diff --git a/src/pseudoopcodes.c b/src/pseudoopcodes.c index fb63304..ddf5db7 100644 --- a/src/pseudoopcodes.c +++ b/src/pseudoopcodes.c @@ -68,6 +68,8 @@ void notreallypo_setpc(void) // GotByte is '*' mutually exclusive with all other arguments! this would mean to keep all previous segment data, so it could be used with "*=*-5" or "*=*+3" + } else if (strcmp(GlobalDynaBuf->buffer, "outfilestart") == 0) { +FIXME set flag to automatically do "!outfilestart" afterward. } else if (strcmp(GlobalDynaBuf->buffer, "name") == 0) { skip '=' read segment name (quoted string!) */ @@ -129,20 +131,15 @@ static enum eos po_xor(void) // select output file and format ("!to" pseudo opcode) static enum eos po_to(void) { - // bugfix: first read filename, *then* check for first pass. - // if skipping right away, quoted colons might be misinterpreted as EOS - // FIXME - fix the skipping code to handle quotes! :) - // "!sl" has been fixed as well + // only act upon this pseudo opcode in first pass + if (!FIRST_PASS) + return SKIP_REMAINDER; // read filename to global dynamic buffer // if no file name given, exit (complaining will have been done) if (input_read_output_filename()) return SKIP_REMAINDER; - // only act upon this pseudo opcode in first pass - if (!FIRST_PASS) - return SKIP_REMAINDER; - if (outputfile_set_filename()) return SKIP_REMAINDER; @@ -771,20 +768,15 @@ static enum eos po_set(void) // now GotByte = illegal char // set file name for symbol list static enum eos po_symbollist(void) { - // bugfix: first read filename, *then* check for first pass. - // if skipping right away, quoted colons might be misinterpreted as EOS - // FIXME - why not just fix the skipping code to handle quotes? :) - // "!to" has been fixed as well + // only process this pseudo opcode in first pass + if (!FIRST_PASS) + return SKIP_REMAINDER; // read filename to global dynamic buffer // if no file name given, exit (complaining will have been done) if (input_read_output_filename()) return SKIP_REMAINDER; - // only process this pseudo opcode in first pass - if (!FIRST_PASS) - return SKIP_REMAINDER; - // if symbol list file name already set, complain and exit if (symbollist_filename) { Throw_warning("Symbol list file name already chosen."); diff --git a/src/version.h b/src/version.h index 2d6157e..7a092a0 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 "12 Feb" // update before release FIXME +#define CHANGE_DATE "13 Feb" // 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 diff --git a/testing/Makefile b/testing/Makefile index 95d2efb..4653004 100644 --- a/testing/Makefile +++ b/testing/Makefile @@ -1,13 +1,26 @@ .SILENT: -all: +.PHONY: cpus errors warnings + +all: bugfixes cpus errors warnings + +bugfixes: + echo "Testing bugfixes..." + echo + make -C bugfixes + +cpus: echo "Testing CPUs..." echo make -C cpus + +errors: echo "Testing errors..." echo make -C errors + +warnings: echo "Testing warnings..." echo make -C warnings diff --git a/testing/bugfixes/Makefile b/testing/bugfixes/Makefile new file mode 100644 index 0000000..0c40a61 --- /dev/null +++ b/testing/bugfixes/Makefile @@ -0,0 +1,15 @@ +ACMEFLAGS = -v0 +FILES := $(wildcard *.a) +TESTS = $(subst .a,.test,$(FILES)) + +.SILENT: + +%.test: %.a + echo "Testing bugfix:" $< + acme $(ACMEFLAGS) $< + echo "Ok." + +all: $(TESTS) + echo + echo "Testing bugfixes: PASSED" + echo diff --git a/testing/bugfixes/executed-quotes.a b/testing/bugfixes/executed-quotes.a new file mode 100644 index 0000000..48bd51e --- /dev/null +++ b/testing/bugfixes/executed-quotes.a @@ -0,0 +1,5 @@ + *=$1000 + ; the "skip code" function did not honor quotes, so stuff after ':' was + ; executed. + !ifdef UNDEFINED !tx " dummy : older versions tried to parse this!" + ; fixing this supersedes two older fixes for "!to" and "!sl". diff --git a/testing/cpus/Makefile b/testing/cpus/Makefile index 613641c..062a47a 100644 --- a/testing/cpus/Makefile +++ b/testing/cpus/Makefile @@ -8,7 +8,7 @@ FILES = $(foreach N,$(CPUS),$(N).o) echo "Testing CPU:" $(subst .o,,$@) acme $(ACMEFLAGS) -o test.o $< cmp test.o expected-$@ - rm test.o + $(RM) test.o echo "Ok." all: $(FILES) diff --git a/testing/errors/userdefined1.a b/testing/errors/userdefined1.a new file mode 100644 index 0000000..4b19f66 --- /dev/null +++ b/testing/errors/userdefined1.a @@ -0,0 +1 @@ + !error "they'd all made a big mistake in coming down from the trees in the first place." diff --git a/testing/errors/userdefined2.a b/testing/errors/userdefined2.a new file mode 100644 index 0000000..3651fe3 --- /dev/null +++ b/testing/errors/userdefined2.a @@ -0,0 +1 @@ + !serious "even the trees had been a bad move, no one should ever have left the oceans." diff --git a/testing/warnings/userdefined.a b/testing/warnings/userdefined.a new file mode 100644 index 0000000..9687323 --- /dev/null +++ b/testing/warnings/userdefined.a @@ -0,0 +1 @@ + !warn "the trees had been a bad move, no one should ever have left the oceans."