Revert r46073. It caused corlib_test.dll compilation to fail.
authorRaja R Harinath <harinath@hurrynot.org>
Thu, 16 Jun 2005 09:25:34 +0000 (09:25 -0000)
committerRaja R Harinath <harinath@hurrynot.org>
Thu, 16 Jun 2005 09:25:34 +0000 (09:25 -0000)
svn path=/trunk/mcs/; revision=46077

mcs/mcs/ChangeLog
mcs/mcs/cs-tokenizer.cs

index 7d94cc5892a33201b178b7f5123dd5b42fd12fef..2805ab606e0362e0c275c3664aa1c36bafffb5fd 100644 (file)
@@ -2,9 +2,10 @@
 
        * 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.
 
index 250fec25cb1e83baa5c35e2e73c0c13601c22487..ba570e65a0669efb1bfc8ae3d604233120f6d1e0 100644 (file)
@@ -1558,9 +1558,6 @@ namespace Mono.CSharp
                //
                bool handle_preprocessing_directive (bool caller_is_taking)
                {
-                       if (!process_directives)
-                               return true;
-
                        string cmd, arg;
                        bool region_directive = false;
 
@@ -2060,6 +2057,9 @@ namespace Mono.CSharp
                                // 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) {