summaryrefslogtreecommitdiffstats
path: root/src/poem/read.rs
diff options
context:
space:
mode:
authorRory Dudley2024-04-06 23:50:46 -0600
committerRory Dudley2024-04-06 23:50:46 -0600
commit6198c54a9e1155bb9b7f93b8cb5daf3e2deddb25 (patch)
treed02550b9933ee1dbd5c64b088d5d17368f3c40d5 /src/poem/read.rs
parentf5db8d64828db756b80b6022322265a2b4f1c11b (diff)
downloaddwarvish-6198c54a9e1155bb9b7f93b8cb5daf3e2deddb25.tar.gz
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.
Diffstat (limited to 'src/poem/read.rs')
-rw-r--r--src/poem/read.rs4
1 files changed, 4 insertions, 0 deletions
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