neutralts/bif/
parse_bif_coalesce.rs

1#![doc = include_str!("../../doc/bif-coalesce.md")]
2
3use crate::{bif::constants::*, bif::Bif, bif::BifError};
4
5impl<'a> Bif<'a> {
6    /*
7       {:coalesce;
8           {:code;  :}
9           {:code; this is output :}
10           {:code; ... :}
11       :}
12    */
13    pub(crate) fn parse_bif_coalesce(&mut self) -> Result<(), BifError> {
14        if self.mod_filter || self.mod_negate {
15            return Err(self.bif_error(BIF_ERROR_MODIFIER_NOT_ALLOWED));
16        }
17
18        // This var so as not to overwrite the original: inherit.last_bif_out
19        self.inherit.last_coalesce_out = false;
20        self.out = new_child_parse!(self, &self.src, self.mod_scope);
21
22        Ok(())
23    }
24}
25
26#[cfg(test)]
27#[path = "parse_bif_coalesce_tests.rs"]
28mod tests;