@@ -613,28 +613,6 @@ profile_file(VALUE self, VALUE filepath) {
613
613
return Qnil ;
614
614
}
615
615
616
- // The function takes a source string and returns a Ruby array containing the
617
- // offsets of every newline in the string. (It also includes a 0 at the
618
- // beginning to indicate the position of the first line.) It accepts a string as
619
- // its only argument and returns an array of integers.
620
- static VALUE
621
- newlines (VALUE self , VALUE string ) {
622
- yp_parser_t parser ;
623
- size_t length = RSTRING_LEN (string );
624
- yp_parser_init (& parser , RSTRING_PTR (string ), length , NULL );
625
-
626
- yp_node_t * node = yp_parse (& parser );
627
- yp_node_destroy (& parser , node );
628
-
629
- VALUE result = rb_ary_new_capa (parser .newline_list .size );
630
- for (size_t index = 0 ; index < parser .newline_list .size ; index ++ ) {
631
- rb_ary_push (result , INT2FIX (parser .newline_list .offsets [index ]));
632
- }
633
-
634
- yp_parser_free (& parser );
635
- return result ;
636
- }
637
-
638
616
/******************************************************************************/
639
617
/* Initialization of the extension */
640
618
/******************************************************************************/
@@ -683,7 +661,6 @@ Init_yarp(void) {
683
661
rb_define_singleton_method (rb_cYARP , "unescape_all" , unescape_all , 1 );
684
662
rb_define_singleton_method (rb_cYARP , "memsize" , memsize , 1 );
685
663
rb_define_singleton_method (rb_cYARP , "profile_file" , profile_file , 1 );
686
- rb_define_singleton_method (rb_cYARP , "newlines" , newlines , 1 );
687
664
688
665
// Next, initialize the pack API.
689
666
Init_yarp_pack ();
0 commit comments