Copying latest mcs to the branch.
[mono.git] / mcs / gmcs / cs-tokenizer.cs
index 5e41511364982588d371d76c014b0865d5df9374..8f9e3d89a17757e5239cdd2d1f92280df0eb81c1 100644 (file)
@@ -567,7 +567,7 @@ namespace Mono.CSharp
                                return true;
                        else if ((the_token == Token.COMMA) || (the_token == Token.DOT))
                                goto start;
-                       else if (the_token == Token.INTERR)
+                       else if (the_token == Token.INTERR || the_token == Token.STAR)
                                goto again;
                        else if (the_token == Token.OP_GENERICS_LT) {
                                if (!parse_less_than ())
@@ -1853,7 +1853,7 @@ namespace Mono.CSharp
                                }
                                bool taking = false;
                                if (ifstack == null)
-                                       ifstack = new Stack ();
+                                       ifstack = new Stack (2);
 
                                if (ifstack.Count == 0){
                                        taking = true;
@@ -2086,6 +2086,7 @@ namespace Mono.CSharp
                        current_location = new Location (ref_line, Col);
 
                        while ((c = getChar ()) != -1) {
+                       loop:
                                if (is_identifier_part_character ((char) c)){
                                        if (pos == max_id_size){
                                                Report.Error (645, Location, "Identifier too long (limit is 512 chars)");
@@ -2094,6 +2095,9 @@ namespace Mono.CSharp
                                        
                                        id_builder [pos++] = (char) c;
 //                                     putback_char = -1;
+                               } else if (c == '\\') {
+                                       c = escape (c);
+                                       goto loop;
                                } else {
 //                                     putback_char = c;
                                        putback (c);
@@ -2329,9 +2333,9 @@ namespace Mono.CSharp
                        if (c == -1)
                                return Token.EOF;
 
-                       if (is_identifier_start_character ((char)c)){
+                       if (c == '\\' || is_identifier_start_character ((char)c)){
                                tokens_seen = true;
-                                       return consume_identifier (c);
+                               return consume_identifier (c);
                        }
 
                        current_location = new Location (ref_line, Col);