[csharp] repl using statement fix + support for --fatal
[mono.git] / mcs / mcs / cs-tokenizer.cs
index 0f5a2886a2a802ae5d05cabc20e73a74f739ac7c..4692fccda80b3e80cd5badfa0ae906bff34030d2 100644 (file)
@@ -15,9 +15,7 @@
 using System;
 using System.Text;
 using System.Collections.Generic;
-using System.IO;
 using System.Globalization;
-using System.Reflection;
 using System.Diagnostics;
 
 namespace Mono.CSharp
@@ -556,6 +554,7 @@ namespace Mono.CSharp
                        AddKeyword ("while", Token.WHILE);
                        AddKeyword ("partial", Token.PARTIAL);
                        AddKeyword ("where", Token.WHERE);
+                       AddKeyword ("async", Token.ASYNC);
 
                        // LINQ keywords
                        AddKeyword ("from", Token.FROM);
@@ -764,6 +763,13 @@ namespace Mono.CSharp
 
                                res = -1;
                                break;
+
+                       case Token.ASYNC:
+                               if (parsing_block > 0 || RootContext.Version != LanguageVersion.Future) {
+                                       res = -1;
+                                       break;
+                               }
+                               break;
                        }
 
                        return res;
@@ -2176,7 +2182,7 @@ namespace Mono.CSharp
                                                                                Report.RegisterWarningRegion (loc).WarningEnable (loc, code, Report);
                                                                        }
                                                                }
-                                                       } while (code >= 0 && c != '\n');
+                                                       } while (code >= 0 && c != '\n' && c != -1);
                                                }
 
                                                return;