Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

2005-04-24 Chris Toshok <toshok@ximian.com>

	* frontend/Command.cs (SetCommand): override DoResolve and
	DoExecute so we can both handle debugger settings as well as
	expressions representing assignments ("set lang auto" and "set x =
	3", respectively).


svn path=/trunk/debugger/; revision=43511
  • Loading branch information...
commit 9b17964b3b05f20ba0ac67d8e9f2a5b6b806644f 1 parent 9daf87b
authored April 24, 2005
7  ChangeLog
... ...
@@ -1,3 +1,10 @@
  1
+2005-04-24  Chris Toshok  <toshok@ximian.com>
  2
+
  3
+	* frontend/Command.cs (SetCommand): override DoResolve and
  4
+	DoExecute so we can both handle debugger settings as well as
  5
+	expressions representing assignments ("set lang auto" and "set x =
  6
+	3", respectively).
  7
+
1 8
 2005-04-22  Chris Toshok  <toshok@ximian.com>
2 9
 
3 10
 	* backends/MonoThreadManager.cs (MonoThreadManager.ThreadCreated):
26  frontend/Command.cs
@@ -1219,6 +1219,8 @@ public override void Complete (Engine e, string text, int start, int end)
1219 1219
 
1220 1220
 	public class SetCommand : NestedCommand, IDocumentableCommand
1221 1221
 	{
  1222
+		Expression expr;
  1223
+
1222 1224
 #region set subcommands
1223 1225
 		private class SetLangCommand : DebuggerCommand
1224 1226
 		{
@@ -1279,6 +1281,30 @@ public SetCommand ()
1279 1281
 			RegisterSubcommand ("style", typeof (SetStyleCommand));
1280 1282
 		}
1281 1283
 
  1284
+		protected override bool DoResolve (ScriptingContext context)
  1285
+		{
  1286
+			if (Argument != "") {
  1287
+				Expression e = ParseExpression (context);
  1288
+				if (e is AssignmentExpression) {
  1289
+					expr = e.Resolve (context);
  1290
+					return (expr != null);
  1291
+				}
  1292
+			}
  1293
+
  1294
+			return base.DoResolve (context);
  1295
+		}
  1296
+
  1297
+		protected override void DoExecute (ScriptingContext context)
  1298
+		{	  	
  1299
+			if (expr != null) {
  1300
+				expr.Evaluate (context);
  1301
+			}
  1302
+			else {
  1303
+				base.DoExecute (context);
  1304
+			}
  1305
+		}
  1306
+
  1307
+
1282 1308
 		// IDocumentableCommand
1283 1309
 		public CommandFamily Family { get { return CommandFamily.Support; } }
1284 1310
 		public string Description { get { return "Set things."; } }

0 notes on commit 9b17964

Please sign in to comment.
Something went wrong with that request. Please try again.