2008-09-04 Miguel de Icaza <miguel@novell.com>
authorMiguel de Icaza <miguel@gnome.org>
Thu, 4 Sep 2008 06:50:28 +0000 (06:50 -0000)
committerMiguel de Icaza <miguel@gnome.org>
Thu, 4 Sep 2008 06:50:28 +0000 (06:50 -0000)
* repl.cs (PrettyPrint): Add Hashtable prettyprint

* anonymous.cs (AnonymousTypeClass): On EvalMode make the class
public.

* repl.cs: Update help.

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

mcs/mcs/ChangeLog
mcs/mcs/Makefile
mcs/mcs/anonymous.cs
mcs/mcs/repl.cs

index 6f5339fe97480a21d7a0cb72bef70d82328c0efe..db1dbf747a85c7bdd7d44d5db4353ff79493a447 100644 (file)
@@ -1,3 +1,12 @@
+2008-09-04  Miguel de Icaza  <miguel@novell.com>
+
+       * repl.cs (PrettyPrint): Add Hashtable prettyprint
+
+       * anonymous.cs (AnonymousTypeClass): On EvalMode make the class
+       public. 
+
+       * repl.cs: Update help.
+
 2008-09-03  Miguel de Icaza  <miguel@novell.com>
 
        * driver.cs (ProcessDefaultConfig): Now it encapsulates all the
index 08d093125b296d1706f5e76ebf0ed812d5f17575..cfcf2a9c6a5d238d9f0fc37c0aa625c1b7d514f8 100644 (file)
@@ -142,6 +142,7 @@ q: cs-parser.cs qh
        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
+       echo -e 'var a = from f in System.IO.Directory.GetFiles ("/tmp") where f == "passwd" select f;' | mono gmcs.exe --shell
 
 # read-eval-print-loop test target, for quickly hackign
 repl: 
index 80cc270e8565eb9fc4be9ea57f5ee7fcf72a7017..993364663e846d2662d66c6362004fe3e6cbf623 100644 (file)
@@ -1596,7 +1596,7 @@ namespace Mono.CSharp {
                readonly ArrayList parameters;
 
                private AnonymousTypeClass (DeclSpace parent, MemberName name, ArrayList parameters, Location loc)
-                       : base (parent, name, Modifiers.SEALED)
+                       : base (parent, name, (RootContext.EvalMode ? Modifiers.PUBLIC : 0) | Modifiers.SEALED)
                {
                        this.parameters = parameters;
                }
index 934a064cfed505706d22b475e0efcc83bdc7c10e..c2e5a5f90a0d372d8cb34cb207f1c5d58a947800 100644 (file)
@@ -457,6 +457,23 @@ namespace Mono.CSharp {
                                        p ("false");
                        } else if (result is string){
                                p (String.Format ("\"{0}\"", EscapeString ((string)result)));
+                       } else if (result is Hashtable){
+                               Hashtable h = (Hashtable) result;
+                               int top = h.Count, count = 0;
+                               
+                               p ("{");
+                               foreach (object k in h.Keys){
+                                       count++;
+                                       p ("{ ");
+                                       PrettyPrint (k);
+                                       p (", ");
+                                       PrettyPrint (h [k]);
+                                       if (count != top)
+                                               p (" }, ");
+                                       else
+                                               p (" }");
+                               }
+                               p ("}");
                        } else {
                                p (result.ToString ());
                        }
@@ -683,7 +700,7 @@ namespace Mono.CSharp {
                {
                        CloneContext cc = new CloneContext ();
                        Expression clone = source.Clone (cc);
-                       
+
                        clone = clone.Resolve (ec);
                        if (clone == null)
                                return null;
@@ -827,7 +844,9 @@ namespace Mono.CSharp {
                                return  "Static methods:\n"+
                                        "  LoadPackage (pkg); - Loads the given Package (like -pkg:FILE)\n" +
                                        "  ShowVars ();       - Shows defined local variables.\n" +
-                                       "  ShowUsing ();      - Show active using decltions.\n" + 
+                                       "  ShowUsing ();      - Show active using decltions.\n" +
+                                       "  Prompt             - The prompt used by the C# shell\n" +
+                                       "  ContinuationPrompt - The prompt for partial input\n" + 
                                        "  help;\n";
                        }