svn path=/trunk/mcs/; revision=46077
* cs-tokenizer.cs (process_directives): New flag for controlling
the processing of preprocessor directives.
- (handle_preprocessing_directive): Exit early when not processing
- directives. This avoids unnecessary processing during the token
- peek in is_punct().
+ (x_token): After seeing a '#', return Token.NONE instead of going
+ to handle_preprocessing_directive() when not processing
+ directives. This avoids unnecessary processing during the token peek in
+ is_punct().
This fixes #74939.
//
bool handle_preprocessing_directive (bool caller_is_taking)
{
- if (!process_directives)
- return true;
-
string cmd, arg;
bool region_directive = false;
// FIXME: In C# the '#' is not limited to appear
// on the first column.
if (c == '#') {
+ // return NONE if we're not processing directives (during token peeks)
+ if (!process_directives)
+ return Token.NONE;
bool cont = true;
if (tokens_seen || comments_seen) {