neutralts/bif/
parse_bif_coalesce.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#![doc = include_str!("../../doc/bif-coalesce.md")]

use crate::{bif::constants::*, bif::Bif, bif::BifError};

impl<'a> Bif<'a> {
    /*
       {:coalesce;
           {:code;  :}
           {:code; this is output :}
           {:code; ... :}
       :}
    */
    pub(crate) fn parse_bif_coalesce(&mut self) -> Result<(), BifError> {
        if self.mod_filter || self.mod_negate {
            return Err(self.bif_error(BIF_ERROR_MODIFIER_NOT_ALLOWED));
        }

        // This var so as not to overwrite the original: inherit.last_bif_out
        self.inherit.last_coalesce_out = false;
        self.out = new_child_parse!(self, &self.src, self.mod_scope);

        Ok(())
    }
}

#[cfg(test)]
#[path = "parse_bif_coalesce_tests.rs"]
mod tests;