From 6198c54a9e1155bb9b7f93b8cb5daf3e2deddb25 Mon Sep 17 00:00:00 2001 From: Rory Dudley Date: Sat, 6 Apr 2024 23:50:46 -0600 Subject: Add 'strings' to the verse after the string!() macro This patches fixes a bug, where sometimes, when a Rune::String was detected, the resulting string from the string!() macro wasn't getting pushed to the current verse. --- src/poem/read.rs | 4 ++++ src/poem/read/parse.rs | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/poem/read.rs b/src/poem/read.rs index 0af7fec..3578a92 100644 --- a/src/poem/read.rs +++ b/src/poem/read.rs @@ -111,6 +111,8 @@ impl Readable for Poem { None => { // Check for IO parse errors if last == Rune::Read || last == Rune::Write || last == Rune::Addendum { + println!("err 0"); + println!("{:?}", verse); return Err(Mishap::IOMishap(j, i, ' ')); } @@ -120,6 +122,7 @@ impl Readable for Poem { // Throw an error if the verse is empty if verse.is_empty() && (last == Rune::Couplet || last == Rune::And) { + println!("err 1"); return Err(Mishap::ParseMishap(j, i, ' ')); } @@ -210,6 +213,7 @@ impl Readable for Poem { // Indicates a string (' or ") Rune::String => { string!(chars, j, i, c, word); + verse.add(&mut word); } // Indicates a sub-poem diff --git a/src/poem/read/parse.rs b/src/poem/read/parse.rs index 70367c4..58c8fde 100644 --- a/src/poem/read/parse.rs +++ b/src/poem/read/parse.rs @@ -41,7 +41,6 @@ macro_rules! string { } } } - continue; }; } -- cgit v1.2.3