diff --git a/src/acme.c b/src/acme.c index 83acee3..db7da21 100644 --- a/src/acme.c +++ b/src/acme.c @@ -478,9 +478,11 @@ static const char *long_option(const char *string) config.honor_leading_zeroes = FALSE; else if (strcmp(string, OPTION_STRICT_SEGMENTS) == 0) config.segment_warning_is_error = TRUE; - else if (strcmp(string, OPTION_TEST) == 0) + else if (strcmp(string, OPTION_TEST) == 0) { + if (config.test_new_features) + config.backslash_escaping = TRUE; config.test_new_features = TRUE; - PLATFORM_LONGOPTION_CODE + } PLATFORM_LONGOPTION_CODE else if (strcmp(string, OPTION_COLOR) == 0) config.format_color = TRUE; else if (strcmp(string, OPTION_VERSION) == 0) diff --git a/src/config.h b/src/config.h index 3f1931f..c820adc 100644 --- a/src/config.h +++ b/src/config.h @@ -29,16 +29,31 @@ struct number { } val; int addr_refs; // address reference count (only look at this if value is DEFINED) }; -// structure for ints/floats/TODO... +// structure for ints/floats/lists/strings (TODO) struct type; +struct string; +struct listitem; struct object { struct type *type; union { struct number number; + struct string *string; + struct listitem *listhead; // TODO - add string struct } u; }; - +struct string { + int length; + int refs; + char payload[1]; // real structs are malloc'd to correct size +}; +struct listitem { + struct listitem *next; + struct listitem *prev; + int length; // only used if item is list head (head itself is not included in length) + int refs; // only used if item is list head + struct object payload; +}; // debugging flag, should be undefined in release version // #define FDEBUG diff --git a/src/global.c b/src/global.c index 248c290..b932b62 100644 --- a/src/global.c +++ b/src/global.c @@ -130,6 +130,7 @@ void config_default(struct config *conf) conf->honor_leading_zeroes = TRUE; // disabled by --ignore-zeroes conf->segment_warning_is_error = FALSE; // enabled by --strict-segments TODO - toggle default? conf->test_new_features = FALSE; // enabled by --test + conf->backslash_escaping = FALSE; // enabled by --test --test } // memory allocation stuff diff --git a/src/global.h b/src/global.h index 1097593..fc1f6ea 100644 --- a/src/global.h +++ b/src/global.h @@ -75,6 +75,7 @@ struct config { boolean honor_leading_zeroes; // TRUE, disabled by --ignore-zeroes boolean segment_warning_is_error; // FALSE, enabled by --strict-segments boolean test_new_features; // FALSE, enabled by --test + boolean backslash_escaping; // FALSE, enabled by --test --test }; extern struct config config; diff --git a/src/input.c b/src/input.c index 944b2cc..80f940a 100644 --- a/src/input.c +++ b/src/input.c @@ -327,7 +327,13 @@ void Input_ensure_EOS(void) // Now GotByte = first char to test { SKIPSPACE(); if (GotByte) { - Throw_error("Garbage data at end of statement."); + char buf[80]; // actually needed are 51 + char quote = '\''; + + if (GotByte == '\'') + quote = '"'; + sprintf(buf, "Garbage data at end of statement (unexpected %c%c%c).", quote, GotByte, quote); // FIXME - change in docs! + Throw_error(buf); Input_skip_remainder(); } } diff --git a/src/version.h b/src/version.h index e1ef291..c5a509b 100644 --- a/src/version.h +++ b/src/version.h @@ -9,7 +9,7 @@ #define RELEASE "0.96.5" // update before release FIXME #define CODENAME "Fenchurch" // update before release -#define CHANGE_DATE "15 May" // update before release FIXME +#define CHANGE_DATE "18 May" // update before release FIXME #define CHANGE_YEAR "2020" // update before release //#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/" #define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME