@@ -1127,36 +1127,6 @@ inspect_node(VALUE self, VALUE source) {
1127
1127
1128
1128
#endif
1129
1129
1130
- /**
1131
- * call-seq:
1132
- * Debug::format_errors(source, colorize) -> String
1133
- *
1134
- * Format the errors that are found when parsing the given source string.
1135
- */
1136
- static VALUE
1137
- format_errors (VALUE self , VALUE source , VALUE colorize ) {
1138
- pm_string_t input ;
1139
- input_load_string (& input , source );
1140
-
1141
- pm_parser_t parser ;
1142
- pm_parser_init (& parser , pm_string_source (& input ), pm_string_length (& input ), NULL );
1143
-
1144
- pm_node_t * node = pm_parse (& parser );
1145
- pm_buffer_t buffer = { 0 };
1146
-
1147
- pm_parser_errors_format (& parser , & parser .error_list , & buffer , RTEST (colorize ), true);
1148
-
1149
- rb_encoding * encoding = rb_enc_find (parser .encoding -> name );
1150
- VALUE result = rb_enc_str_new (pm_buffer_value (& buffer ), pm_buffer_length (& buffer ), encoding );
1151
-
1152
- pm_buffer_free (& buffer );
1153
- pm_node_destroy (& parser , node );
1154
- pm_parser_free (& parser );
1155
- pm_string_free (& input );
1156
-
1157
- return result ;
1158
- }
1159
-
1160
1130
/**
1161
1131
* call-seq: Debug::Encoding.all -> Array[Debug::Encoding]
1162
1132
*
@@ -1309,7 +1279,6 @@ Init_prism(void) {
1309
1279
// Next, the functions that will be called by the parser to perform various
1310
1280
// internal tasks. We expose these to make them easier to test.
1311
1281
VALUE rb_cPrismDebug = rb_define_module_under (rb_cPrism , "Debug" );
1312
- rb_define_singleton_method (rb_cPrismDebug , "format_errors" , format_errors , 2 );
1313
1282
1314
1283
#ifndef PRISM_EXCLUDE_PRETTYPRINT
1315
1284
rb_define_singleton_method (rb_cPrismDebug , "inspect_node" , inspect_node , 1 );
0 commit comments