Skip to content

Commit

Permalink
Add SetFunctions::execute stub
Browse files Browse the repository at this point in the history
  • Loading branch information
magicant committed Nov 3, 2023
1 parent 2081458 commit 08bb265
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion yash-builtin/src/typeset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ use yash_syntax::source::pretty::{Annotation, AnnotationType, Message, MessageBa
use yash_syntax::source::Location;

mod print_variables;
mod set_functions;
mod set_variables;
pub mod syntax;

Expand Down Expand Up @@ -413,7 +414,7 @@ impl Command {
match self {
Self::SetVariables(command) => command.execute(env),
Self::PrintVariables(command) => command.execute(&env.variables),
Self::SetFunctions(command) => todo!("{command:?}"), // command.execute(env),
Self::SetFunctions(command) => command.execute(&mut env.functions),
Self::PrintFunctions(command) => todo!("{command:?}"), // command.execute(env),
}
}
Expand Down
26 changes: 26 additions & 0 deletions yash-builtin/src/typeset/set_functions.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// This file is part of yash, an extended POSIX shell.
// Copyright (C) 2023 WATANABE Yuki
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

use super::*;
use yash_env::function::FunctionSet;

impl SetFunctions {
/// Executes the command.
pub fn execute(self, functions: &mut FunctionSet) -> Result<String, Vec<ExecuteError>> {
_ = functions;
todo!()
}
}

0 comments on commit 08bb265

Please sign in to comment.