2008-08-26 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Tue, 26 Aug 2008 22:41:04 +0000 (22:41 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Tue, 26 Aug 2008 22:41:04 +0000 (22:41 -0000)
* Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
limitations in Console, instead the 2.0 bootstrap libraries now
include the Console bits.

Also, remove the use of Nullables from getline.cs

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

mcs/mcs/ChangeLog
mcs/mcs/Makefile
mcs/mcs/getline.cs
mcs/mcs/repl.cs

index 656d481fe970de1069479c34aeed5ce369acc4f7..e112877cff78fb268881253e97eb808b785d142a 100644 (file)
@@ -1,5 +1,13 @@
 2008-08-26  Miguel de Icaza  <miguel@novell.com>
 
+       * Makefile: Drop BOOTSTRAP_COMPILER as that was masking the
+       limitations in Console, instead the 2.0 bootstrap libraries now
+       include the Console bits.
+
+       Also, remove the use of Nullables from getline.cs
+
+       ------------
+       
        Interactive support for the C# compiler.   Use gmcs --shell to
        enter a read-eval-print loop shell.
 
index 038ac8b78dd7eb8271c72b214262176495105bdb..0e44e7765f57fb2565aec5ac549b1197458ca1fb 100644 (file)
@@ -61,7 +61,7 @@ else
 
 ifeq (net_2_0, $(PROFILE))
 
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/net_2_0_bootstrap/gmcs.exe $(DEBUG_FLAGS) -define:BOOTSTRAP_COMPILER
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/net_2_0_bootstrap$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/net_2_0_bootstrap/gmcs.exe $(DEBUG_FLAGS)
 
 clean-local: clean-net_2_0_bootstrap
 clean-net_2_0_bootstrap:
index 15ecd961363bffc22709f0745582a6c35c23e4f1..b38597c72e6329c26c012e9d62856c5ddc830e53 100644 (file)
@@ -23,7 +23,7 @@
 #endif
 
 // Only compile this code in the 2.0 profile, but not in the Moonlight one
-#if (IN_MCS_BUILD && NET_2_0 && !SMCS_SOURCE && !BOOTSTRAP_COMPILER) || !IN_MCS_BUILD
+#if (IN_MCS_BUILD && NET_2_0 && !SMCS_SOURCE) || !IN_MCS_BUILD
 using System;
 using System.Text;
 using System.IO;
@@ -85,29 +85,26 @@ namespace Mono.Terminal {
                delegate void KeyHandler ();
                
                struct Handler {
-                       public ConsoleKeyInfo? CKI;
-                       public char? c;
+                       public ConsoleKeyInfo CKI;
                        public KeyHandler KeyHandler;
 
                        public Handler (ConsoleKey key, KeyHandler h)
                        {
                                CKI = new ConsoleKeyInfo ((char) 0, key, false, false, false);
                                KeyHandler = h;
-                               c = null;
                        }
 
                        public Handler (char c, KeyHandler h)
                        {
                                KeyHandler = h;
-                               this.c = c;
-                               CKI = null;
+                               // Use the "Zoom" as a flag that we only have a character.
+                               CKI = new ConsoleKeyInfo ((char) c, ConsoleKey.Zoom, false, false, false);
                        }
 
                        public Handler (ConsoleKeyInfo cki, KeyHandler h)
                        {
                                CKI = cki;
                                KeyHandler = h;
-                               c = null;
                        }
                        
                        public static Handler Control (char c, KeyHandler h)
@@ -629,16 +626,14 @@ namespace Mono.Terminal {
 
                                bool handled = false;
                                foreach (Handler handler in handlers){
-                                       if (handler.CKI.HasValue){
-                                               ConsoleKeyInfo t = handler.CKI.Value;
-
-                                               if (t.Key == cki.Key && t.Modifiers == cki.Modifiers){
-                                                       handled = true;
-                                                       handler.KeyHandler ();
-                                                       last_handler = handler.KeyHandler;
-                                                       break;
-                                               } 
-                                       } else if (handler.c == cki.KeyChar){
+                                       ConsoleKeyInfo t = handler.CKI;
+
+                                       if (t.Key == cki.Key && t.Modifiers == cki.Modifiers){
+                                               handled = true;
+                                               handler.KeyHandler ();
+                                               last_handler = handler.KeyHandler;
+                                               break;
+                                       } else if (t.KeyChar == cki.KeyChar){
                                                handled = true;
                                                handler.KeyHandler ();
                                                last_handler = handler.KeyHandler;
index cfd767abdaec9a94232e76a0c1e056965172e060..e9a56a105eed7388f3bf76f20e793a4bd5f5eb81 100644 (file)
@@ -30,7 +30,7 @@ namespace Mono.CSharp {
                static int count;
                static string current_debug_name;
 
-#if NET_2_0 && !SMCS_SOURCE && !BOOTSTRAP_COMPILER
+#if NET_2_0 && !SMCS_SOURCE
                static Mono.Terminal.LineEditor editor;
 
                static void SetupEditor ()
@@ -118,8 +118,6 @@ namespace Mono.CSharp {
                                
                                expr = Evaluate (expr);
                        } 
-
-                       return 0;
                }
 
                
@@ -408,6 +406,11 @@ namespace Mono.CSharp {
                        return base.Equals (obj);
                }
 
+               public override int GetHashCode ()
+               {
+                       return name.GetHashCode ();
+               }
+               
                override public Expression DoResolveLValue (EmitContext ec, Expression right_side)
                {
                        Expression ret = base.DoResolveLValue (ec, right_side);