2008-09-03 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Thu, 4 Sep 2008 00:33:04 +0000 (00:33 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Thu, 4 Sep 2008 00:33:04 +0000 (00:33 -0000)
* driver.cs (ProcessDefaultConfig): Now it encapsulates all the
handling of the default config handling, including the special
treatment of System.Core assembly.

Fixes the REPL processing for LINQ.

svn path=/trunk/mcs/; revision=112223

mcs/mcs/ChangeLog
mcs/mcs/Makefile
mcs/mcs/driver.cs

index 5b45863d858113dbb52635ad330205bd071a1ba8..6f5339fe97480a21d7a0cb72bef70d82328c0efe 100644 (file)
@@ -1,3 +1,11 @@
+2008-09-03  Miguel de Icaza  <miguel@novell.com>
+
+       * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
+       handling of the default config handling, including the special
+       treatment of System.Core assembly. 
+
+       Fixes the REPL processing for LINQ.
+
 2008-09-03  Marek Safar  <marek.safar@gmail.com>
 
        A fix for bug #422507
index a4712e1fa7fa1087b0d4c829c91774ad3b3bdaac..08d093125b296d1706f5e76ebf0ed812d5f17575 100644 (file)
@@ -141,6 +141,7 @@ q: cs-parser.cs qh
        echo -e '"foo" == "bar";' | mono --debug gmcs.exe -v --shell
        echo -e 'var a = 1;\na + 2;' | mono --debug gmcs.exe -v --shell
        echo -e 'int j;\nj = 1;' | mono --debug gmcs.exe -v --shell
+       echo -e 'var a = new int[]{1,2,3};\nfrom x in a select x;' | mono --debug gmcs.exe -v --shell
 
 # read-eval-print-loop test target, for quickly hackign
 repl: 
index 47a1ae6d2ebc6c2f47fa74e667b92fa83d4d5725..a430ca00c11ef82a4716ca19c5ac6da54c1f117b 100644 (file)
@@ -742,8 +742,23 @@ namespace Mono.CSharp
                        }
                }
 
-               public static void DefineDefaultConfig ()
+               public void ProcessDefaultConfig ()
                {
+                       bool need_system_core = RootContext.Version > LanguageVersion.ISO_2;
+                       
+                       if (!load_default_config){
+                               //
+                               // Yet another SRE related problem, we have to always load System.Core
+                               // even with -noconfig, otherwise the check for ExtensionAttribute in
+                               // loaded assemblies won't work
+                               //
+                               Console.WriteLine ("HERE");
+                               if (need_system_core && references.Count != 0 && Driver.OutputFile != "System.Core.dll")
+                                       soft_references.Add ("System.Core");
+                               
+                               return;
+                       }
+                       
                        //
                        // For now the "default config" is harcoded into the compiler
                        // we can move this outside later
@@ -782,6 +797,9 @@ namespace Mono.CSharp
                        };
 
                        soft_references.AddRange (default_config);
+
+                       if (need_system_core)
+                               soft_references.Add ("System.Core");
                }
 
                public static string OutputFile
@@ -1582,8 +1600,7 @@ namespace Mono.CSharp
 
                int StartInteractiveShell ()
                {
-                       if (load_default_config)
-                               DefineDefaultConfig ();
+                       ProcessDefaultConfig ();
                        return InteractiveShell.ReadEvalPrintLoop ();
                }
                
@@ -1602,18 +1619,7 @@ namespace Mono.CSharp
                        if (RootContext.ToplevelTypes.NamespaceEntry != null)
                                throw new InternalErrorException ("who set it?");
 
-                       if (load_default_config)
-                               DefineDefaultConfig ();
-
-                       //
-                       // Yet another SRE related problem, we have to always load System.Core
-                       // even with -noconfig, otherwise the check for ExtensionAttribute in
-                       // loaded assemblies won't work
-                       // 
-                       if (RootContext.Version > LanguageVersion.ISO_2 &&
-                               (load_default_config || references.Count != 0) &&
-                               Driver.OutputFile != "System.Core.dll")
-                               soft_references.Add ("System.Core");
+                       ProcessDefaultConfig ();
 
                        //
                        // Load assemblies required