diff options
author | Rory Dudley | 2024-05-12 23:53:57 -0600 |
---|---|---|
committer | Rory Dudley | 2024-05-12 23:53:57 -0600 |
commit | 908cd899695ba07bfc47645c532337958ee208d7 (patch) | |
tree | 002106e38a373468c0827f84665d31507a081612 /src/poem/read/parse.rs | |
parent | 9b4785ce4f89ea50c00459f260f4a00050a6a48a (diff) | |
download | dwarvish-908cd899695ba07bfc47645c532337958ee208d7.tar.gz |
Fix regression with aliases
Fixed a regression that was introduced in:
1415c8f9b89699000ef8d864ff8f0e1bebca4a5f.
Moving aliases to read() broke how pipes worked. This commit removes the
troublesome append!() macro, and replaces it with some logic in the
add() function (impl Appendable for Poem).
Diffstat (limited to 'src/poem/read/parse.rs')
-rw-r--r-- | src/poem/read/parse.rs | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/src/poem/read/parse.rs b/src/poem/read/parse.rs index 58c8fde..7b01d85 100644 --- a/src/poem/read/parse.rs +++ b/src/poem/read/parse.rs @@ -84,31 +84,3 @@ macro_rules! poem { $word.push('\x0b'); }; } - -/// Append a verse to the poem -/// -/// Append a verse to poem, first checking for aliases in the environment, and -/// processing the alias first, if necessary. -#[macro_export] -macro_rules! append { - ($poem:expr, $last:expr, $meter:expr, $verse:expr, $env:expr) => { - if !$verse.is_empty() { - match $env.aliases.get(&$verse.verb()) { - Some(alias) => { - let alias = alias.to_string(); - let mut poem = Poem::read(alias, $env)?; - let len = poem.len(); - for (i, verse) in poem.iter_mut().enumerate() { - if $verse.clause().is_some() && i + 1 == len { - verse.stanza.append(&mut $verse.clause().unwrap()); - } - $poem.push(verse.clone()); - } - } - None => { - $poem.add(&mut $verse, $last, $meter); - } - } - } - }; -} |