mirror of
https://github.com/cc65/cc65.git
synced 2025-01-12 02:30:44 +00:00
Don't check for open .IF clauses when reaching the end of pushed input data.
This will allow to write macros that contain open .IFs. git-svn-id: svn://svn.cc65.org/cc65/trunk@3740 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
parent
6679cc6080
commit
b6cb833560
@ -1211,27 +1211,31 @@ CharAgain:
|
||||
return;
|
||||
|
||||
case EOF:
|
||||
/* Check if we have any open .IFs in this file */
|
||||
CheckOpenIfs ();
|
||||
/* Check if we have any open token lists in this file */
|
||||
CheckInputStack ();
|
||||
|
||||
/* If this was an include file, then close it and read the next
|
||||
* token. When an include file is opened, the last token of the
|
||||
* old file is not skipped, to prevent the lookahead to read
|
||||
* the next line of the old input file. So we do effectively
|
||||
* skip the last token in the old file (the file name of the
|
||||
* include statement).
|
||||
* In case of the main file, do not close it, but return EOF.
|
||||
*/
|
||||
CheckInputStack ();
|
||||
if (IData) {
|
||||
/* Input came from internal data */
|
||||
DoneInputData ();
|
||||
goto Again;
|
||||
} else if (ICount > 1) {
|
||||
/* We're at the end of an include file. Check if we have any
|
||||
* open .IFs, or any open token lists in this file. This
|
||||
* enforcement is artificial, using conditionals that start
|
||||
* in one file and end in another are uncommon, and don't
|
||||
* allowing these things will help finding errors.
|
||||
*/
|
||||
CheckOpenIfs ();
|
||||
|
||||
/* Close the include file and read the next token. When an
|
||||
* include file is opened, the last token of the old file is
|
||||
* not skipped, to prevent the lookahead to read the next line
|
||||
* of the old input file. So we do effectively skip the last
|
||||
* token in the old file (the file name of the include
|
||||
* statement).
|
||||
*/
|
||||
DoneInputFile ();
|
||||
goto Again;
|
||||
} else {
|
||||
/* In case of the main file, do not close it, but return EOF. */
|
||||
Tok = TOK_EOF;
|
||||
}
|
||||
return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user