/* * call-seq: * token_stream.text = text -> text * * Set the text attribute of the TokenStream to the text you wish to be * tokenized. For example, you may do this; * * token_stream.text = File.read(file_name) */ static VALUE frb_ts_set_text(VALUE self, VALUE rtext) { TokenStream *ts; Data_Get_Struct(self, TokenStream, ts); StringValue(rtext); ts->reset(ts, rs2s(rtext)); /* prevent garbage collection */ rb_ivar_set(self, id_text, rtext); return rtext; }