From 501c04f4b655caca6f615e2385a9ac58a46ecd8f Mon Sep 17 00:00:00 2001 From: "David F. Skoll" Date: Tue, 20 Apr 2010 14:01:54 -0400 Subject: [PATCH] More work on purge mode. --- src/dorem.c | 10 +++++----- src/main.c | 14 +++++++------- tests/purge_dir/f3.rem | 7 +++++++ 3 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/dorem.c b/src/dorem.c index 5a7f424b..32208fa4 100644 --- a/src/dorem.c +++ b/src/dorem.c @@ -59,11 +59,11 @@ int DoRem(ParsePtr p) if ( (r=ParseRem(p, &trig, &tim, 1)) ) return r; if (trig.typ == NO_TYPE) { - PurgeEchoLine("%s\n%s\n", "#!PURGE Cannot parse next line", CurLine); + PurgeEchoLine("%s\n%s\n", "#!P! Cannot parse next line", CurLine); return E_EOLN; } if (trig.typ == SAT_TYPE) { - PurgeEchoLine("%s\n", "#!PURGE Cannot purge SATISFY-type reminders"); + PurgeEchoLine("%s\n", "#!P: Cannot purge SATISFY-type reminders"); PurgeEchoLine("%s\n", CurLine); r=DoSatRemind(&trig, &tim, p); if (r) return r; @@ -99,7 +99,7 @@ int DoRem(ParsePtr p) jul = ComputeTrigger(trig.scanfrom, &trig, &r, 1); if (r) { if (PurgeMode) { - PurgeEchoLine("%s: %s\n", "#!PURGE Problem calculating trigger date", ErrMsg[r]); + PurgeEchoLine("%s: %s\n", "#!P! Problem calculating trigger date", ErrMsg[r]); PurgeEchoLine("%s\n", CurLine); } return r; @@ -109,10 +109,10 @@ int DoRem(ParsePtr p) if (PurgeMode) { if (trig.expired || jul < JulianToday) { if (p->expr_happened) { - PurgeEchoLine("%s\n", "#!PURGE Next line may have expired, but contains expression"); + PurgeEchoLine("%s\n", "#!P: Next line may have expired, but contains expression"); PurgeEchoLine("%s\n", CurLine); } else { - PurgeEchoLine("#!PURGE EXPIRED: %s\n", CurLine); + PurgeEchoLine("#!P: Expired: %s\n", CurLine); } } else { PurgeEchoLine("%s\n", CurLine); diff --git a/src/main.c b/src/main.c index 05a6e07d..c333df40 100644 --- a/src/main.c +++ b/src/main.c @@ -265,7 +265,7 @@ static void DoReminders(void) PurgeEchoLine("%s\n", CurLine); } else { if (r) { - PurgeEchoLine("#!PURGE Could not parse next line: %s\n", ErrMsg[r]); + PurgeEchoLine("#!P! Could not parse next line: %s\n", ErrMsg[r]); PurgeEchoLine("%s\n", CurLine); } } @@ -715,8 +715,8 @@ int DoIf(ParsePtr p) } else { syndrome = IF_FALSE | BEFORE_ELSE; if (PurgeMode) { - PurgeEchoLine("%s\n", "#!PURGE The next IF evaluated false..."); - PurgeEchoLine("%s\n", "#!PURGE REM statements in IF block not checked for purging."); + PurgeEchoLine("%s\n", "#!P: The next IF evaluated false..."); + PurgeEchoLine("%s\n", "#!P: REM statements in IF block not checked for purging."); } } } @@ -748,8 +748,8 @@ int DoElse(ParsePtr p) IfFlags |= AFTER_ELSE << (2 * NumIfs - 2); if (PurgeMode && ShouldIgnoreLine() && !was_ignoring) { - PurgeEchoLine("%s\n", "#!PURGE The previous IF evaluated true."); - PurgeEchoLine("%s\n", "#!PURGE REM statements in ELSE block not checked for purging"); + PurgeEchoLine("%s\n", "#!P: The previous IF evaluated true."); + PurgeEchoLine("%s\n", "#!P: REM statements in ELSE block not checked for purging"); } return VerifyEoln(p); } @@ -795,8 +795,8 @@ int DoIfTrig(ParsePtr p) } else { syndrome = IF_FALSE | BEFORE_ELSE; if (PurgeMode) { - PurgeEchoLine("%s\n", "#!PURGE The next IFTRIG did not trigger."); - PurgeEchoLine("%s\n", "#!PURGE REM statements in IFTRIG block not checked for purging."); + PurgeEchoLine("%s\n", "#!P: The next IFTRIG did not trigger."); + PurgeEchoLine("%s\n", "#!P: REM statements in IFTRIG block not checked for purging."); } } } diff --git a/tests/purge_dir/f3.rem b/tests/purge_dir/f3.rem index 72b61a87..f9bdca68 100644 --- a/tests/purge_dir/f3.rem +++ b/tests/purge_dir/f3.rem @@ -16,3 +16,10 @@ IFTRIG 1991 REM MSG wookie ENDIF +REM [1990+1] MSG old-with-expression + +REM [1990+1] \ + MSG Continued line + +REM 1990 \ + MSG expired-continued-line