Upsilon/Upsilon/Binder/BoundStatements/BoundScript.cs

41 lines
1.2 KiB
C#

using System.Collections;
using System.Collections.Generic;
using Upsilon.Evaluator;
using Upsilon.Text;
namespace Upsilon.Binder
{
public class BoundScript : BoundStatement
{
public Script Script { get; }
public BoundScript(BoundBlockStatement statement, TextSpan span, BoundScope scope, string fileName, Script script) : base(span)
{
Statement = statement;
Scope = scope;
FileName = fileName;
Script = script;
}
public string FileName { get; set; }
public override BoundKind Kind => BoundKind.BoundScript;
public override IEnumerable<BoundNode> GetChildren()
{
yield return Statement;
}
public BoundBlockStatement Statement { get; }
public BoundScope Scope { get; }
internal override void Evaluate(EvaluationScope scope, Diagnostics diagnostics, ref EvaluationState state)
{
Statement.Evaluate(scope, diagnostics, ref state);
}
internal override IEnumerator EvaluateCoroutine(EvaluationScope scope, Diagnostics diagnostics, EvaluationState state)
{
return Statement.EvaluateCoroutine(scope, diagnostics, state);
}
}
}