From f9e55a0d13218745fecd4cc848d1caaa0d4b134c Mon Sep 17 00:00:00 2001 From: marcobaye Date: Tue, 6 May 2014 22:16:41 +0000 Subject: [PATCH] Release 0.94.9: C-style "==" operator is now recognized (but gives a warning). git-svn-id: https://svn.code.sf.net/p/acme-crossass/code-0/trunk@29 4df02467-bbd4-4a76-a152-e7ce94205b78 --- docs/Changes.txt | 8 ++++++++ docs/Errors.txt | 3 +++ src/acme.c | 4 ++-- src/alu.c | 7 ++++++- src/mnemo.c | 4 ++-- 5 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/Changes.txt b/docs/Changes.txt index ca7fb57..5ebfe53 100644 --- a/docs/Changes.txt +++ b/docs/Changes.txt @@ -12,6 +12,14 @@ platform used. There should be another help file in this archive outlining the platform specific changes. +---------------------------------------------------------------------- +Section: New in release 0.94.9 +---------------------------------------------------------------------- + +C-style equality checking ("==" operator) is now recognized (but gives + a warning). Thanks to groepaz for the suggestion. + + ---------------------------------------------------------------------- Section: New in release 0.94.8 ---------------------------------------------------------------------- diff --git a/docs/Errors.txt b/docs/Errors.txt index 1575a79..5f74d3a 100644 --- a/docs/Errors.txt +++ b/docs/Errors.txt @@ -52,6 +52,9 @@ Bug in ACME, code follows A situation has been encountered implying there is a bug in ACME. See the last section in this file. +C-style "==" comparison detected + To check for equality, use a single '=' character instead. + Implicit label definition not in leftmost column. An implicit label definition has blanks before the label name. Imagine this source code: diff --git a/src/acme.c b/src/acme.c index 1a59ae8..b87caa9 100644 --- a/src/acme.c +++ b/src/acme.c @@ -15,9 +15,9 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -#define RELEASE "0.94.8" // update before release (FIXME) +#define RELEASE "0.94.9" // update before release (FIXME) #define CODENAME "Zarquon" // update before release -#define CHANGE_DATE "11 Mar" // update before release +#define CHANGE_DATE "7 May" // update before release #define CHANGE_YEAR "2014" // update before release //#define HOME_PAGE "http://home.pages.de/~mac_bacon/smorbrod/acme/" // FIXME #define HOME_PAGE "http://sourceforge.net/p/acme-crossass/" // FIXME diff --git a/src/alu.c b/src/alu.c index c62807b..c94c18c 100644 --- a/src/alu.c +++ b/src/alu.c @@ -763,7 +763,12 @@ static void expect_dyadic_operator(void) case '=': // is equal operator = &ops_equals; - goto get_byte_and_push_dyadic; + // if it's "==", accept but warn + if (GetByte() == '=') { + Throw_warning("C-style \"==\" comparison detected"); + goto get_byte_and_push_dyadic; + } + goto push_dyadic; case ')': // closing parenthesis operator = &ops_closing; diff --git a/src/mnemo.c b/src/mnemo.c index 03ee198..de83688 100644 --- a/src/mnemo.c +++ b/src/mnemo.c @@ -136,7 +136,7 @@ SCS jump_lind[] = { 0, 0, 0, 0xdc00, 0xdc00, 0, // error message strings static const char exception_illegal_combination[] = "Illegal combination of command and addressing mode."; -static const char exception_highbyte_zero[]= "Using oversized addressing mode."; +static const char exception_highbyte_zero[] = "Using oversized addressing mode."; // Variables @@ -146,7 +146,7 @@ static struct dynabuf *mnemo_dyna_buf; // dynamic buffer for mnemonics static struct node_t *mnemo_6502_tree = NULL; // holds 6502 mnemonics static struct node_t *mnemo_6510_tree = NULL; // holds 6510 extensions static struct node_t *mnemo_65c02_tree = NULL; // holds 65c02 extensions -//static node_t *mnemo_Rockwell65c02_tree = NULL; // Rockwell +//static struct node_t *mnemo_Rockwell65c02_tree = NULL; // Rockwell static struct node_t *mnemo_WDC65c02_tree = NULL; // WDC's "stp"/"wai" static struct node_t *mnemo_65816_tree = NULL; // holds 65816 extensions