static void FreeIf (void)
/* Free all .IF descriptors until we reach one with the NeedTerm bit set */
{
- int Done = 0;
+ int Done;
do {
IfDesc* D = GetCurrentIf();
if (D == 0) {
SetIfCond (D, 1);
SkipUntilSep ();
}
- }
+ }
IfCond = GetCurrentIfCond ();
break;
case TOK_IFP816:
D = AllocIf (".IFP816", 1);
- NextTok ();
+ NextTok ();
if (IfCond) {
SetIfCond (D, GetCPU() == CPU_65816);
}
+int CheckConditionals (void)
+/* Check if the current token is one that starts a conditional directive, and
+ * call DoConditionals if so. Return true if a conditional directive was found,
+ * return false otherwise.
+ */
+{
+ switch (Tok) {
+ case TOK_ELSE:
+ case TOK_ELSEIF:
+ case TOK_ENDIF:
+ case TOK_IF:
+ case TOK_IFBLANK:
+ case TOK_IFCONST:
+ case TOK_IFDEF:
+ case TOK_IFNBLANK:
+ case TOK_IFNCONST:
+ case TOK_IFNDEF:
+ case TOK_IFNREF:
+ case TOK_IFP02:
+ case TOK_IFP816:
+ case TOK_IFPC02:
+ case TOK_IFPSC02:
+ case TOK_IFREF:
+ DoConditionals ();
+ return 1;
+
+ default:
+ return 0;
+ }
+}
+
+
+
void CheckOpenIfs (void)
/* Called from the scanner before closing an input file. Will check for any
* open .ifs in this file.