scanner/context: fix flow de/increment

I forgot when removing the macro that I need to actually assign the
computation to self.flow
This commit is contained in:
Paul Stemmet 2021-07-30 09:42:55 +00:00 committed by Paul Stemmet
parent 37221ad020
commit 9e295b8f72
1 changed files with 8 additions and 2 deletions

View File

@ -61,12 +61,18 @@ impl Context
pub fn flow_increment(&mut self) -> Result<usize>
{
self.flow.checked_add(1).ok_or(ScanError::IntOverflow)
let new = self.flow.checked_add(1).ok_or(ScanError::IntOverflow)?;
self.flow = new;
Ok(new)
}
pub fn flow_decrement(&mut self) -> Result<usize>
{
self.flow.checked_sub(1).ok_or(ScanError::IntOverflow)
let new = self.flow.checked_sub(1).ok_or(ScanError::IntOverflow)?;
self.flow = new;
Ok(new)
}
/// Get the current indent level