More work on purge mode.

This commit is contained in:
David F. Skoll
2010-04-20 14:01:54 -04:00
parent d294e62be1
commit 501c04f4b6
3 changed files with 19 additions and 12 deletions

View File

@@ -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);

View File

@@ -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.");
}
}
}

View File

@@ -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