filtrex.js
function removeErrorRecovery (fn) {
    var parseFn = String(fn);
    try {
        var JSONSelect = require("JSONSelect");
        var Reflect = require("reflect");
        var ast = Reflect.parse(parseFn);

        var labeled = JSONSelect.match(':has(:root > .label > .name:val("_handle_error"))', ast);
        labeled[0].body.consequent.body = [labeled[0].body.consequent.body[0], labeled[0].body.consequent.body[1]];

        return Reflect.stringify(ast).replace(/_handle_error:\s?/,"").replace(/\\\\n/g,"\\n");
    } catch (e) {
        return parseFn;
    }
}
function removeErrorRecovery (fn) {
    var parseFn = String(fn);
    try {
        var JSONSelect = require("JSONSelect");
        var Reflect = require("reflect");
        var ast = Reflect.parse(parseFn);

        var labeled = JSONSelect.match(':has(:root > .label > .name:val("_handle_error"))', ast);
        labeled[0].body.consequent.body = [labeled[0].body.consequent.body[0], labeled[0].body.consequent.body[1]];

        return Reflect.stringify(ast).replace(/_handle_error:\s?/,"").replace(/\\\\n/g,"\\n");
    } catch (e) {
        return parseFn;
    }
}
function removeErrorRecovery ( fn ) { var parseFn = String ( fn ) ; try { var JSONSelect = require ( "JSONSelect" ) ; var Reflect = require ( "reflect" ) ; var ast = Reflect . parse ( parseFn ) ; var labeled = JSONSelect . match ( ':has(:root > .label > .name:val("_handle_error"))' , ast ) ; labeled [ 0 ] . body . consequent . body = [ labeled [ 0 ] . body . consequent . body [ 0 ] , labeled [ 0 ] . body . consequent . body [ 1 ] ] ; return Reflect . stringify ( ast ) . replace ( / _handle_error:\s? / , "" ) . replace ( / \\\\n / g , "\\n" ) ; } catch ( e ) { return parseFn ; } }
returns parse function without error recovery code
returns parse function without error recovery code