Author: duncan
Date: 2005-06-15 17:57:38 -0400 (Wed, 15 Jun 2005)
New Revision: 46073

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/cs-tokenizer.cs
Log:

2005-06-15  Duncan Mak  <[EMAIL PROTECTED]>

        * cs-tokenizer.cs (handle_preprocessing_directive): Exit early
        when not processing directives. This avoids unnecessary
        processing during the token peek in is_punct().

        This really fixes #74939.

        Testcase coming once I figure out what Martin wants to with
        the MCS testsuite.

Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2005-06-15 20:24:51 UTC (rev 46072)
+++ trunk/mcs/mcs/ChangeLog     2005-06-15 21:57:38 UTC (rev 46073)
@@ -2,10 +2,9 @@
 
        * cs-tokenizer.cs (process_directives): New flag for controlling
        the processing of preprocessor directives.
-       (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().
+       (handle_preprocessing_directive): Exit early when not processing
+       directives. This avoids unnecessary processing during the token
+       peek in is_punct().
 
        This fixes #74939.
 

Modified: trunk/mcs/mcs/cs-tokenizer.cs
===================================================================
--- trunk/mcs/mcs/cs-tokenizer.cs       2005-06-15 20:24:51 UTC (rev 46072)
+++ trunk/mcs/mcs/cs-tokenizer.cs       2005-06-15 21:57:38 UTC (rev 46073)
@@ -1558,6 +1558,9 @@
                //
                bool handle_preprocessing_directive (bool caller_is_taking)
                {
+                       if (!process_directives)
+                               return true;
+
                        string cmd, arg;
                        bool region_directive = false;
 
@@ -2057,9 +2060,6 @@
                                // 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) {

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to