use std::str::FromStr;
use crate::{ClasspadChar, ClasspadString};
impl ClasspadString {
pub fn attach_classpad_str(&mut self, other: &mut ClasspadString) -> &mut Self {
self.0.append(&mut other.0);
self
}
pub fn attach_str(&mut self, other: &str) -> &mut Self {
self.0
.append(&mut ClasspadString::from_str(other).unwrap().0);
self
}
pub fn attach_classpad_char(&mut self, ch: usize) -> &mut Self {
if let Some(ch) = ClasspadChar::from_classpad_char(ch) {
self.0.push(ch);
}
self
}
pub fn attach_integral(&mut self) -> &mut Self {
self.0.push(ClasspadChar::from_unicode_char('∫').unwrap());
self
}
}