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:
parent
37221ad020
commit
9e295b8f72
|
@ -61,12 +61,18 @@ impl Context
|
||||||
|
|
||||||
pub fn flow_increment(&mut self) -> Result<usize>
|
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>
|
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
|
/// Get the current indent level
|
||||||
|
|
Loading…
Reference in New Issue