2025-10-16 15:20:53 +08:00
|
|
|
|
using Convention.RScript.Parser;
|
|
|
|
|
using System.Diagnostics.CodeAnalysis;
|
|
|
|
|
|
|
|
|
|
namespace Convention.RScript.Runner
|
|
|
|
|
{
|
|
|
|
|
public class ExpressionRunner : IRSentenceRunner
|
|
|
|
|
{
|
2025-10-17 15:46:44 +08:00
|
|
|
|
public void Compile(ExpressionParser parser, RScriptSentence sentence, RScriptContext context)
|
|
|
|
|
{
|
|
|
|
|
parser.Compile(sentence.content);
|
|
|
|
|
}
|
|
|
|
|
|
2025-10-16 15:20:53 +08:00
|
|
|
|
[return: MaybeNull]
|
|
|
|
|
public object Run(ExpressionParser parser, RScriptSentence sentence, RScriptContext context)
|
|
|
|
|
{
|
|
|
|
|
return parser.Evaluate(sentence.content);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|