From 9b3e4dd71ec1491e3580e079e9be1b42117a74c9 Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Thu, 4 Apr 2024 00:47:24 -0600 Subject: Add better support for aliases Make sure to interpret alias values as their own poems, since aliases can be fairly complex. --- src/poem/anthology.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/poem/anthology.rs') diff --git a/src/poem/anthology.rs b/src/poem/anthology.rs index e48e6c6..79f48f2 100644 --- a/src/poem/anthology.rs +++ b/src/poem/anthology.rs @@ -43,14 +43,14 @@ pub fn lookup(verb: &str) -> Option { /// ... /// } /// ``` -pub fn incant(verse: &Verse, index: usize, env: &mut Environment) -> i32 { +pub fn incant(verse: &Verse, out: &mut String, index: usize, env: &mut Environment) -> i32 { let verb = INDEX[index]; match verb { - "alias" => alias::incant(verse, &mut env.aliases), + "alias" => alias::incant(verse, out, &mut env.aliases), "cd" => cd::incant(verse), "exit" => exit::incant(), "export" => export::incant(verse), - "source" => source::incant(verse, env), + "source" => source::incant(verse, out, env), "unalias" => alias::unincant(verse, &mut env.aliases), "unset" => export::unincant(verse), _ => unreachable!(), -- cgit v1.2.3