Skip to content

Commit

Permalink
Implement String#[]=
Browse files Browse the repository at this point in the history
  • Loading branch information
richardboehme committed Mar 20, 2022
1 parent cac5ae5 commit d051c2a
Show file tree
Hide file tree
Showing 5 changed files with 751 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/natalie/string_object.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class StringObject : public Object {
Value ord(Env *);
Value prepend(Env *, size_t, Value *);
Value ref(Env *, Value);
Value refeq(Env *, Value, Value, Value);
Value reverse(Env *);
Value reverse_in_place(Env *);
Value rstrip(Env *) const;
Expand Down
1 change: 1 addition & 0 deletions lib/natalie/compiler/binding_gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,7 @@ def generate_name
gen.binding('String', '===', 'StringObject', 'eq', argc: 1, pass_env: true, pass_block: false, return_type: :bool)
gen.binding('String', '=~', 'StringObject', 'eqtilde', argc: 1, pass_env: true, pass_block: false, return_type: :Object)
gen.binding('String', '[]', 'StringObject', 'ref', argc: 1, pass_env: true, pass_block: false, return_type: :Object)
gen.binding('String', '[]=', 'StringObject', 'refeq', argc: 1..3, pass_env: true, pass_block: false, return_type: :Object)
gen.binding('String', 'b', 'StringObject', 'b', argc: 0, pass_env: true, pass_block: false, return_type: :Object)
gen.binding('String', 'bytes', 'StringObject', 'bytes', argc: 0, pass_env: true, pass_block: true, return_type: :Object)
gen.binding('String', 'bytesize', 'StringObject', 'bytesize', argc: 0, pass_env: false, pass_block: false, return_type: :size_t)
Expand Down
Loading

0 comments on commit d051c2a

Please sign in to comment.