public static DeclarationExecuter Build(Declaration declaration) { return(declaration switch { DefineDeclaration define => new DefineDeclarationExecuter(define), VariableDeclaration variable => new VariableDeclarationExecuter(variable), SoundsDeclaration sounds => new SoundsDeclarationExecuter(sounds), ActionDeclaration action => new ActionDeclarationExecuter(action), EventDeclaration evt => new EventDeclarationExecuter(evt), _ => ErrorHelper.ThrowUnknownNode <DeclarationExecuter>(declaration) });
public DefineDeclarationExecuter(DefineDeclaration define) : base(define) { name = define.Identifier.Name; value = ExpressionExecuter.Build(define.Value); }