diff options
author | Rory Dudley | 2024-04-06 23:50:46 -0600 |
---|---|---|
committer | Rory Dudley | 2024-04-06 23:50:46 -0600 |
commit | 6198c54a9e1155bb9b7f93b8cb5daf3e2deddb25 (patch) | |
tree | d02550b9933ee1dbd5c64b088d5d17368f3c40d5 | |
parent | f5db8d64828db756b80b6022322265a2b4f1c11b (diff) | |
download | dwarvish-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.
-rw-r--r-- | src/poem/read.rs | 4 | ||||
-rw-r--r-- | src/poem/read/parse.rs | 1 |
2 files changed, 4 insertions, 1 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 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; }; } |