forked from scriptcs/scriptcs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSharpReplEngine.cs
More file actions
26 lines (23 loc) · 899 Bytes
/
CSharpReplEngine.cs
File metadata and controls
26 lines (23 loc) · 899 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
using System.Collections.Generic;
using Microsoft.CodeAnalysis.Scripting;
using ScriptCs.Contracts;
namespace ScriptCs.Engine.Roslyn
{
public class CSharpReplEngine : CSharpScriptEngine, IReplEngine
{
public CSharpReplEngine(IScriptHostFactory scriptHostFactory, ILogProvider logProvider)
: base(scriptHostFactory, logProvider)
{
}
public ICollection<string> GetLocalVariables(ScriptPackSession scriptPackSession)
{
return this.GetLocalVariables(SessionKey, scriptPackSession);
}
protected override ScriptResult Execute(string code, object globals, SessionState<ScriptState> sessionState)
{
return string.IsNullOrWhiteSpace(FileName) && !IsCompleteSubmission(code)
? ScriptResult.Incomplete
: base.Execute(code, globals, sessionState);
}
}
}