add string split method
This commit is contained in:
parent
7438b2c9e5
commit
6961fcc9fa
4 changed files with 90 additions and 2 deletions
11
src/stl.rs
11
src/stl.rs
|
|
@ -74,6 +74,17 @@ pub fn static_stdlib(syms: &mut SymTable) -> Result<(), String> {
|
|||
},
|
||||
);
|
||||
|
||||
syms.insert(
|
||||
"split".to_string(),
|
||||
Symbol {
|
||||
name: String::from("split"),
|
||||
args: Args::Strict(vec![Type::String, Type::String]),
|
||||
conditional_branches: false,
|
||||
docs: strings::SPLIT_DOCSTRING.to_string(),
|
||||
value: ValueType::Internal(Rc::new(strings::split_callback)),
|
||||
},
|
||||
);
|
||||
|
||||
syms.insert(
|
||||
"strlen".to_string(),
|
||||
Symbol {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue