Skip to content
This repository has been archived by the owner on Nov 3, 2023. It is now read-only.

Commit

Permalink
Update to the master api
Browse files Browse the repository at this point in the history
  • Loading branch information
marek-safar committed Apr 2, 2012
1 parent 1e74ed8 commit ed745e6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions gsharp/Main.cs
Expand Up @@ -93,7 +93,7 @@ public static void StartAgent ()
InteractiveGraphicsBase.Attached = true;
Gtk.Application.Invoke (delegate {
try {
evaluator = new Evaluator (new CompilerSettings (), new Report (new ConsoleReportPrinter ()));
evaluator = new Evaluator (new CompilerContext (new CompilerSettings (), new ConsoleReportPrinter ()));
} catch {
return;
}
Expand Down Expand Up @@ -146,4 +146,4 @@ public static void Start (string title, List<string> files)
}
}
}
}
}
11 changes: 6 additions & 5 deletions gsharp/Shell.cs
Expand Up @@ -52,7 +52,7 @@ public class Shell : TextView
TextMark end_of_last_processing;
string expr;
Evaluator evaluator;
Report report;
CompilerContext context;

List<string> history = new List<string> ();
int history_cursor;
Expand All @@ -74,8 +74,9 @@ public Shell(MainWindow container) : base()
Buffer.InsertWithTagsByName (ref end, "Mono C# Shell, type 'help;' for help\n\nEnter statements or expressions below.\n", "Comment");
ShowPrompt (false);

report = new Report (new ConsoleReportPrinter ());
evaluator = new Evaluator (new CompilerSettings (), report);

context = new CompilerContext (new CompilerSettings (), new ConsoleReportPrinter ());
evaluator = new Evaluator (context);
evaluator.DescribeTypeExpressions = true;

evaluator.InteractiveBaseClass = typeof (InteractiveGraphicsBase);
Expand Down Expand Up @@ -145,7 +146,7 @@ public bool Evaluate (string s)
bool result_set;
StringWriter errorwriter = new StringWriter ();

var old_printer = report.SetPrinter (new StreamReportPrinter (errorwriter));
var old_printer = context.Report.SetPrinter (new StreamReportPrinter (errorwriter));

try {
res = evaluator.Evaluate (s, out result, out result_set);
Expand All @@ -155,7 +156,7 @@ public bool Evaluate (string s)
ShowPrompt (true, false);
return true;
} finally {
report.SetPrinter (old_printer);
context.Report.SetPrinter (old_printer);
}

// Partial input
Expand Down

0 comments on commit ed745e6

Please sign in to comment.