Upsilon/Upsilon/Binder/BoundStatements/BoundScript.cs

41 lines
1.2 KiB
C#
Raw Normal View History

2019-02-13 17:10:39 +00:00
using System.Collections;
using System.Collections.Generic;
using Upsilon.Evaluator;
using Upsilon.Text;
2018-11-11 17:12:42 +00:00
namespace Upsilon.Binder
{
public class BoundScript : BoundStatement
2018-11-11 17:12:42 +00:00
{
public Script Script { get; }
public BoundScript(BoundBlockStatement statement, TextSpan span, BoundScope scope, string fileName, Script script) : base(span)
2018-11-11 17:12:42 +00:00
{
Statement = statement;
Scope = scope;
FileName = fileName;
Script = script;
2018-11-11 17:12:42 +00:00
}
public string FileName { get; set; }
2018-11-11 17:12:42 +00:00
public override BoundKind Kind => BoundKind.BoundScript;
2019-01-17 12:56:53 +00:00
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);
}
2019-02-13 17:10:39 +00:00
internal override IEnumerator EvaluateCoroutine(EvaluationScope scope, Diagnostics diagnostics, EvaluationState state)
{
return Statement.EvaluateCoroutine(scope, diagnostics, state);
}
2018-11-11 17:12:42 +00:00
}
}