add append function

This commit is contained in:
Aidan Hahn 2021-11-02 19:05:35 -07:00
parent 37eba3008f
commit ee3b53bfb5
No known key found for this signature in database
GPG key ID: 327711E983899316
5 changed files with 79 additions and 3 deletions

View file

@ -14,7 +14,9 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
use crate::str::get_echo;
use crate::append::get_append;
use crate::func::{FTable, func_declare};
use std::rc::Rc;
use std::cell::RefCell;
@ -24,6 +26,9 @@ pub fn get_stdlib() -> Result<Rc<RefCell<FTable>>, String> {
if let Some(s) = func_declare(ft.clone(), Rc::new(RefCell::new(get_echo()))) {
return Err(s)
}
if let Some(s) = func_declare(ft.clone(), Rc::new(RefCell::new(get_append()))) {
return Err(s)
}
return Ok(ft)
}