Author: marek
Date: 2007-10-31 06:15:45 -0500 (Wed, 31 Oct 2007)
New Revision: 88550

Modified:
   trunk/mcs/mcs/ChangeLog
   trunk/mcs/mcs/cs-tokenizer.cs
Log:
2007-10-31  Marek Safar  <[EMAIL PROTECTED]>

        A fix for bug #337719 
        * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
        `from' keyword.



Modified: trunk/mcs/mcs/ChangeLog
===================================================================
--- trunk/mcs/mcs/ChangeLog     2007-10-31 11:09:19 UTC (rev 88549)
+++ trunk/mcs/mcs/ChangeLog     2007-10-31 11:15:45 UTC (rev 88550)
@@ -1,3 +1,9 @@
+2007-10-31  Marek Safar  <[EMAIL PROTECTED]>
+
+       A fix for bug #337719 
+       * cs-tokenizer.cs: Restore identifier buffer when parsing contextual
+       `from' keyword.
+       
 2007-10-30  Marek Safar  <[EMAIL PROTECTED]>
  
        * Makefile (net_2_0_bootstrap/mcs.exe.config): Reverted copy 
gmcs.exe.config.

Modified: trunk/mcs/mcs/cs-tokenizer.cs
===================================================================
--- trunk/mcs/mcs/cs-tokenizer.cs       2007-10-31 11:09:19 UTC (rev 88549)
+++ trunk/mcs/mcs/cs-tokenizer.cs       2007-10-31 11:15:45 UTC (rev 88550)
@@ -456,12 +456,12 @@
                        // followed by any token except ; , =
                        // 
                        if (query_parsing == 0) {
-                               if (res == Token.FROM) {
+                               if (res == Token.FROM && 
!lambda_arguments_parsing) {
                                        PushPosition ();
                                        // HACK: to disable generics 
micro-parser, because PushPosition does not
                                        // store identifiers array
                                        parsing_generic_less_than = 1;
-                                       switch (token ()) {
+                                       switch (xtoken ()) {
                                                case Token.IDENTIFIER:
                                                case Token.INT:
                                                case Token.BOOL:
@@ -474,7 +474,7 @@
                                                case Token.STRING:
                                                case Token.UINT:
                                                case Token.ULONG:
-                                                       int next_token = token 
();
+                                                       int next_token = xtoken 
();
                                                        if (next_token == 
Token.SEMICOLON || next_token == Token.COMMA || next_token == Token.EQUALS)
                                                                goto default;
 
@@ -487,6 +487,9 @@
                                                        break;
                                                default:
                                                        PopPosition ();
+                                                       // HACK: A token is not 
a keyword so we need to restore identifiers buffer
+                                                       // which has been 
overwritten before we grabbed the identifier
+                                                       id_builder [0] = 'f'; 
id_builder [1] = 'r'; id_builder [2] = 'o'; id_builder [3] = 'm';
                                                        return -1;
                                        }
                                        PopPosition ();

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

Reply via email to