From 3c5ae1b3c4a8a38bacb652f86ff27106652c8b2e Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 27 Jul 2000 18:47:57 +0000 Subject: [PATCH] Added .WARNING git-svn-id: svn://svn.cc65.org/cc65/trunk@204 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- src/ca65/error.c | 1 + src/ca65/error.h | 1 + src/ca65/pseudo.c | 14 ++++++++++++++ src/ca65/scanner.c | 1 + src/ca65/scanner.h | 2 ++ 5 files changed, 19 insertions(+) diff --git a/src/ca65/error.c b/src/ca65/error.c index 89616206a..86fd96b29 100644 --- a/src/ca65/error.c +++ b/src/ca65/error.c @@ -83,6 +83,7 @@ void WarningMsg (const FilePos* Pos, unsigned WarnNum, va_list ap) { 2, "Symbol `%s' is defined but never used" }, { 2, "Symbol `%s' is imported but never used" }, { 1, "Cannot track processor status byte" }, + { 0, "User warning: %s" }, }; if (Warnings [WarnNum-1].Level <= WarnLevel) { diff --git a/src/ca65/error.h b/src/ca65/error.h index d45b2ddaf..c7bd9d86c 100644 --- a/src/ca65/error.h +++ b/src/ca65/error.h @@ -55,6 +55,7 @@ enum Warnings { WARN_SYM_NOT_REFERENCED, WARN_IMPORT_NOT_REFERENCED, WARN_CANNOT_TRACK_STATUS, + WARN_USER, WARN_COUNT /* Warning count */ }; diff --git a/src/ca65/pseudo.c b/src/ca65/pseudo.c index 5504ad3c3..fb2a6cee0 100644 --- a/src/ca65/pseudo.c +++ b/src/ca65/pseudo.c @@ -1037,6 +1037,19 @@ static void DoUnexpected (void) +static void DoWarning (void) +/* User warning */ +{ + if (Tok != TOK_STRCON) { + ErrorSkip (ERR_STRCON_EXPECTED); + } else { + Error (WARN_USER, SVal); + SkipUntilSep (); + } +} + + + static void DoWord (void) /* Define words */ { @@ -1167,6 +1180,7 @@ static CtrlDesc CtrlCmdTab [] = { { ccNone, DoUnexpected }, /* .STRLEN */ { ccNone, DoSunPlus }, { ccNone, DoUnexpected }, /* .TCOUNT */ + { ccNone, DoWarning }, { ccNone, DoWord }, { ccNone, DoUnexpected }, /* .XMATCH */ { ccNone, DoZeropage }, diff --git a/src/ca65/scanner.c b/src/ca65/scanner.c index 6d89dc320..901a8761a 100644 --- a/src/ca65/scanner.c +++ b/src/ca65/scanner.c @@ -224,6 +224,7 @@ struct DotKeyword { { "STRLEN", TOK_STRLEN }, { "SUNPLUS", TOK_SUNPLUS }, { "TCOUNT", TOK_TCOUNT }, + { "WARNING", TOK_WARNING }, { "WORD", TOK_WORD }, { "XMATCH", TOK_XMATCH }, { "XOR", TOK_BXOR }, diff --git a/src/ca65/scanner.h b/src/ca65/scanner.h index d180f0c66..4c43b6c85 100644 --- a/src/ca65/scanner.h +++ b/src/ca65/scanner.h @@ -104,6 +104,7 @@ enum Token { TOK_RBRACK, /* ] */ TOK_MACPARAM, /* Macro parameter, not generated by scanner */ + TOK_REPCOUNTER, /* Repeat counter, not generated by scanner */ /* The next ones are tokens for the pseudo instructions. Keep together! */ TOK_FIRSTPSEUDO, @@ -193,6 +194,7 @@ enum Token { TOK_STRLEN, TOK_SUNPLUS, TOK_TCOUNT, + TOK_WARNING, TOK_WORD, TOK_XMATCH, TOK_ZEROPAGE, -- 2.39.5