/* */
/* */
/* */
-/* (C) 2000-2003 Ullrich von Bassewitz */
+/* (C) 2000-2004 Ullrich von Bassewitz */
/* Römerstraße 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
case TOK_ELSE:
D = GetCurrentIf ();
if (D == 0) {
- Error ("Unexpected .ELSE");
+ Error ("Unexpected .ELSE");
} else if (GetElse(D)) {
/* We already had a .ELSE ! */
Error ("Duplicate .ELSE");
IfCond = GetCurrentIfCond ();
}
NextTok ();
+ ExpectSep ();
break;
case TOK_ELSEIF:
*/
if (IfCond == 0) {
SetIfCond (D, ConstExpression ());
+ ExpectSep ();
}
/* Get the new overall condition */
* has been cleanup up, since we may be at end of file.
*/
NextTok ();
+ ExpectSep ();
/* Get the new overall condition */
IfCond = GetCurrentIfCond ();
NextTok ();
if (IfCond) {
SetIfCond (D, ConstExpression ());
+ ExpectSep ();
}
IfCond = GetCurrentIfCond ();
break;
ExprNode* Expr = Expression();
SetIfCond (D, IsConstExpr (Expr, 0));
FreeExpr (Expr);
+ ExpectSep ();
}
IfCond = GetCurrentIfCond ();
break;
ExprNode* Expr = Expression();
SetIfCond (D, !IsConstExpr (Expr, 0));
FreeExpr (Expr);
+ ExpectSep ();
}
IfCond = GetCurrentIfCond ();
break;
if (IfCond) {
SymEntry* Sym = ParseScopedSymName (SYM_FIND_EXISTING);
SetIfCond (D, Sym == 0 || !SymIsDef (Sym));
+ ExpectSep ();
}
IfCond = GetCurrentIfCond ();
break;
if (IfCond) {
SymEntry* Sym = ParseScopedSymName (SYM_FIND_EXISTING);
SetIfCond (D, Sym == 0 || !SymIsRef (Sym));
+ ExpectSep ();
}
IfCond = GetCurrentIfCond ();
break;
SetIfCond (D, GetCPU() == CPU_6502);
}
IfCond = GetCurrentIfCond ();
+ ExpectSep ();
break;
case TOK_IFP816:
SetIfCond (D, GetCPU() == CPU_65816);
}
IfCond = GetCurrentIfCond ();
+ ExpectSep ();
break;
case TOK_IFPC02:
SetIfCond (D, GetCPU() == CPU_65C02);
}
IfCond = GetCurrentIfCond ();
+ ExpectSep ();
break;
case TOK_IFPSC02:
SetIfCond (D, GetCPU() == CPU_65SC02);
}
IfCond = GetCurrentIfCond ();
+ ExpectSep ();
break;
case TOK_IFREF:
if (IfCond) {
SymEntry* Sym = ParseScopedSymName (SYM_FIND_EXISTING);
SetIfCond (D, Sym != 0 && SymIsRef (Sym));
+ ExpectSep ();
}
IfCond = GetCurrentIfCond ();
break;
/* */
/* */
/* */
-/* (C) 2000-2003 Ullrich von Bassewitz */
+/* (C) 2000-2004 Ullrich von Bassewitz */
/* Römerstraße 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
void ConsumeSep (void)
/* Consume a separator token */
{
- /* Accept an EOF as separator */
- if (Tok != TOK_EOF) {
- if (Tok != TOK_SEP) {
- Error ("Unexpected trailing garbage characters");
- SkipUntilSep ();
- }
- if (Tok == TOK_SEP) {
- NextTok ();
- }
+ /* We expect a separator token */
+ ExpectSep ();
+
+ /* If we have one, skip it */
+ if (Tok == TOK_SEP) {
+ NextTok ();
}
}
+void ExpectSep (void)
+/* Check if we've reached a line separator, and output an error if not. Do
+ * not skip the line separator.
+ */
+{
+ if (!TokIsSep (Tok)) {
+ ErrorSkip ("Unexpected trailing garbage characters");
+ }
+}
+
+
+
void EnterRawTokenMode (void)
/* Enter raw token mode. In raw mode, token handling functions are not
* executed, but the function tokens are passed untouched to the upper
/* */
/* */
/* */
-/* (C) 2000-2003 Ullrich von Bassewitz */
+/* (C) 2000-2004 Ullrich von Bassewitz */
/* Römerstraße 52 */
/* D-70794 Filderstadt */
/* EMail: uz@cc65.org */
void SkipUntilSep (void);
/* Skip tokens until we reach a line separator or end of file */
+void ExpectSep (void);
+/* Check if we've reached a line separator, and output an error if not. Do
+ * not skip the line separator.
+ */
+
void EnterRawTokenMode (void);
/* Enter raw token mode. In raw mode, token handling functions are not
* executed, but the function tokens are passed untouched to the upper