aboutsummaryrefslogtreecommitdiff
regexp_simple: {
    input: {
        /rx/ig
    }
    expect_exact: "/rx/gi;"
}

regexp_slashes: {
    input: {
        /\\\/rx\/\\/ig
    }
    expect_exact: "/\\\\\\/rx\\/\\\\/gi;"
}

regexp_1: {
    input: {
        console.log(JSON.stringify("COMPASS? Overpass.".match(/([Sap]+)/ig)));
    }
    expect: {
        console.log(JSON.stringify("COMPASS? Overpass.".match(/([Sap]+)/gi)));
    }
    expect_stdout: '["PASS","pass"]'
}

regexp_2: {
    options = {
        evaluate: true,
        unsafe: true,
    }
    input: {
        console.log(JSON.stringify("COMPASS? Overpass.".match(new RegExp("([Sap]+)", "ig"))));
    }
    expect: {
        console.log(JSON.stringify("COMPASS? Overpass.".match(/([Sap]+)/gi)));
    }
    expect_stdout: '["PASS","pass"]'
}

regexp_properties: {
    options = {
        evaluate: true,
        unsafe: true,
    }
    input: {
        console.log(/abc/g.source, /abc/g.global, /abc/g.ignoreCase, /abc/g.lastIndex, /abc/g.multiline);
    }
    expect: {
        console.log("abc", true, false, /abc/g.lastIndex, false);
    }
    expect_stdout: "abc true false 0 false"
}

issue_3434_1: {
    options = {
        evaluate: true,
        unsafe: true,
    }
    beautify = {
        beautify: true,
    }
    input: {
        var o = {
            "\n": RegExp("\n"),
            "\r": RegExp("\r"),
            "\t": RegExp("\t"),
            "\b": RegExp("\b"),
            "\f": RegExp("\f"),
            "\0": RegExp("\0"),
            "\x0B": RegExp("\x0B"),
            "\u2028": RegExp("\u2028"),
            "\u2029": RegExp("\u2029"),
        };
        for (var c in o)
            console.log(o[c].test("\\"), o[c].test(c));
    }
    expect_exact: [
        "var o = {",
        '    "\\n": /\\n/,',
        '    "\\r": /\\r/,',
        '    "\\t": /\t/,',
        '    "\\b": /\b/,',
        '    "\\f": /\f/,',
        '    "\\0": /\0/,',
        '    "\\v": /\v/,',
        '    "\\u2028": /\\u2028/,',
        '    "\\u2029": /\\u2029/',
        "};",
        "",
        'for (var c in o) console.log(o[c].test("\\\\"), o[c].test(c));',
    ]
    expect_stdout: [
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
    ]
}

issue_3434_2: {
    options = {
        evaluate: true,
        unsafe: true,
    }
    beautify = {
        beautify: true,
    }
    input: {
        var o = {
            "\n": RegExp("\\\n"),
            "\r": RegExp("\\\r"),
            "\t": RegExp("\\\t"),
            "\b": RegExp("\\\b"),
            "\f": RegExp("\\\f"),
            "\0": RegExp("\\\0"),
            "\x0B": RegExp("\\\x0B"),
            "\u2028": RegExp("\\\u2028"),
            "\u2029": RegExp("\\\u2029"),
        };
        for (var c in o)
            console.log(o[c].test("\\"), o[c].test(c));
    }
    expect_exact: [
        "var o = {",
        '    "\\n": /\\n/,',
        '    "\\r": /\\r/,',
        '    "\\t": /\t/,',
        '    "\\b": /\b/,',
        '    "\\f": /\f/,',
        '    "\\0": /\0/,',
        '    "\\v": /\v/,',
        '    "\\u2028": /\\u2028/,',
        '    "\\u2029": /\\u2029/',
        "};",
        "",
        'for (var c in o) console.log(o[c].test("\\\\"), o[c].test(c));',
    ]
    expect_stdout: [
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
    ]
}

issue_3434_3: {
    options = {
        evaluate: true,
        unsafe: true,
    }
    input: {
        RegExp("\n");
        RegExp("\r");
        RegExp("\\n");
        RegExp("\\\n");
        RegExp("\\\\n");
        RegExp("\\\\\n");
        RegExp("\\\\\\n");
        RegExp("\\\\\\\n");
        RegExp("\u2028");
        RegExp("\u2029");
        RegExp("\n\r\u2028\u2029");
        RegExp("\\\nfo\n[\n]o\\bbb");
    }
    expect: {
        /\n/;
        /\r/;
        /\n/;
        /\n/;
        /\\n/;
        /\\\n/;
        /\\\n/;
        /\\\n/;
        /\u2028/;
        /\u2029/;
        /\n\r\u2028\u2029/;
        /\nfo\n[\n]o\bbb/;
    }
}

issue_3434_4: {
    options = {
        evaluate: true,
        unsafe: true,
    }
    input: {
        [
            [ "", RegExp("") ],
            [ "/", RegExp("/") ],
            [ "//", RegExp("//") ],
            [ "\/", RegExp("\\/") ],
            [ "///", RegExp("///") ],
            [ "/\/", RegExp("/\\/") ],
            [ "\//", RegExp("\\//") ],
            [ "\\/", RegExp("\\\\/") ],
            [ "////", RegExp("////") ],
            [ "//\/", RegExp("//\\/") ],
            [ "/\//", RegExp("/\\//") ],
            [ "/\\/", RegExp("/\\\\/") ],
            [ "\///", RegExp("\\///") ],
            [ "\/\/", RegExp("\\/\\/") ],
            [ "\\//", RegExp("\\\\//") ],
            [ "\\\/", RegExp("\\\\\\/") ],
        ].forEach(function(test) {
            console.log(test[1].test("\\"), test[1].test(test[0]));
        });
    }
    expect: {
        [
            [ "", /(?:)/ ],
            [ "/", /\// ],
            [ "//", /\/\// ],
            [ "/", /\// ],
            [ "///", /\/\/\// ],
            [ "//", /\/\// ],
            [ "//", /\/\// ],
            [ "\\/", /\\\// ],
            [ "////", /\/\/\/\// ],
            [ "///", /\/\/\// ],
            [ "///", /\/\/\// ],
            [ "/\\/", /\/\\\// ],
            [ "///", /\/\/\// ],
            [ "//", /\/\// ],
            [ "\\//", /\\\/\// ],
            [ "\\/", /\\\// ],
        ].forEach(function(test) {
            console.log(test[1].test("\\"), test[1].test(test[0]));
        });
    }
    expect_stdout: [
        "true true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
        "false true",
    ]
}

exec: {
    options = {
        evaluate: true,
        loops: true,
        unsafe: true,
    }
    input: {
        while (/a/.exec("AAA"))
            console.log("FAIL");
        console.log("PASS");
    }
    expect: {
        for (;null;)
            console.log("FAIL");
        console.log("PASS");
    }
    expect_stdout: "PASS"
}

exec_global: {
    options = {
        evaluate: true,
        loops: true,
        unsafe: true,
    }
    input: {
        while (/a/g.exec("AAA"))
            console.log("FAIL");
        console.log("PASS");
    }
    expect: {
        for (;null;)
            console.log("FAIL");
        console.log("PASS");
    }
    expect_stdout: "PASS"
}

test: {
    options = {
        evaluate: true,
        unsafe: true,
    }
    input: {
        while (/a/.test("AAA"))
            console.log("FAIL");
        console.log("PASS");
    }
    expect: {
        while (false)
            console.log("FAIL");
        console.log("PASS");
    }
    expect_stdout: "PASS"
}

test_global: {
    options = {
        evaluate: true,
        unsafe: true,
    }
    input: {
        while (/a/g.test("AAA"))
            console.log("FAIL");
        console.log("PASS");
    }
    expect: {
        while (false)
            console.log("FAIL");
        console.log("PASS");
    }
    expect_stdout: "PASS"
}

var_exec: {
    options = {
        evaluate: true,
        loops: true,
        reduce_vars: true,
        toplevel: true,
        unsafe: true,
    }
    input: {
        var r = /a/;
        while (r.exec("AAA"))
            console.log("FAIL");
        console.log("PASS");
    }
    expect: {
        var r = /a/;
        for (;null;)
            console.log("FAIL");
        console.log("PASS");
    }
    expect_stdout: "PASS"
}

var_exec_global: {
    options = {
        evaluate: true,
        loops: true,
        reduce_vars: true,
        toplevel: true,
        unsafe: true,
    }
    input: {
        var r = /a/g;
        while (r.exec("aaa"))
            console.log("PASS");
    }
    expect: {
        var r = /a/g;
        for (;r.exec("aaa");)
            console.log("PASS");
    }
    expect_stdout: [
        "PASS",
        "PASS",
        "PASS",
    ]
}

var_test: {
    options = {
        evaluate: true,
        reduce_vars: true,
        toplevel: true,
        unsafe: true,
    }
    input: {
        var r = /a/;
        while (r.test("AAA"))
            console.log("FAIL");
        console.log("PASS");
    }
    expect: {
        var r = /a/;
        while (false)
            console.log("FAIL");
        console.log("PASS");
    }
    expect_stdout: "PASS"
}

var_test_global: {
    options = {
        evaluate: true,
        reduce_vars: true,
        toplevel: true,
        unsafe: true,
    }
    input: {
        var r = /a/g;
        while (r.test("aaa"))
            console.log("PASS");
    }
    expect: {
        var r = /a/g;
        while (r.test("aaa"))
            console.log("PASS");
    }
    expect_stdout: [
        "PASS",
        "PASS",
        "PASS",
    ]
}

lazy_boolean: {
    options = {
        evaluate: true,
        passes: 2,
        side_effects: true,
        unsafe: true,
    }
    input: {
        /b/.exec({}) && console.log("PASS");
        /b/.test({}) && console.log("PASS");
        /b/g.exec({}) && console.log("PASS");
        /b/g.test({}) && console.log("PASS");
    }
    expect: {
        console.log("PASS");
        console.log("PASS");
        console.log("PASS");
        console.log("PASS");
    }
    expect_stdout: [
        "PASS",
        "PASS",
        "PASS",
        "PASS",
    ]
}

reset_state_between_evaluate: {
    options = {
        evaluate: true,
        passes: 2,
        unsafe: true,
    }
    input: {
        console.log(function() {
            for (var a in /[abc4]/g.exec("a"))
                return "PASS";
            return "FAIL";
        }());
    }
    expect: {
        console.log(function() {
            for (var a in /[abc4]/g.exec("a"))
                return "PASS";
            return "FAIL";
        }());
    }
    expect_stdout: "PASS"
}
mpression.scm (unshield), * gnu/packages/coq.scm (subset), * gnu/packages/dictionaries.scm (translate-shell), * gnu/packages/disk.scm (memkind), * gnu/packages/documentation.scm (latex2html), * gnu/packages/emacs-xyz.scm (emacs-chronometrist, emacs-flycheck-ledger, emacs-counsel-notmuch, emacs-spaceline, emacs-org-generate), * gnu/packages/embedded.scm (ebusd, ebusd-configuration), * gnu/packages/enchant.scm (nuspell), * gnu/packages/fontutils.scm (woff2), * gnu/packages/geo.scm (memphis), * gnu/packages/gimp.scm (mrg), * gnu/packages/gnome-xyz.scm (gnome-shell-extension-appindicator), * gnu/packages/gnome.scm (parlatype), * gnu/packages/golang.scm (go-github-com-tv42-httpunix, go-github-com-ayufan-golang-kardianos-service), * gnu/packages/graphics.scm (eglexternalplatform, egl-wayland, mmm, directfb, flux), * gnu/packages/gstreamer.scm (openni2, ccextractor, libvisual, graphene), * gnu/packages/guile-xyz.scm (guile-srfi-180, guile-torrent), * gnu/packages/image.scm (openjpeg-data), * gnu/packages/java.scm (javacc), * gnu/packages/language.scm (liblouis, liblouisutdml), * gnu/packages/linux.scm (pamela, ttyebus), * gnu/packages/lxqt.scm (lxqt-connman-applet), * gnu/packages/mail.scm (libetpan), * gnu/packages/man.scm (ronn), * gnu/packages/music.scm (tascam-gtk, artyfx), * gnu/packages/networking.scm (srt, lksctp-tools, nng, nanomsg), * gnu/packages/python-crypto.scm (pure-python-otr), * gnu/packages/qt.scm (qtspell), * gnu/packages/raspberry-pi.scm (raspi-gpio, raspi-open-firmware), * gnu/packages/rdp.scm (freerdp), * gnu/packages/ruby.scm (ruby-prawn-templates, ruby-treetop, ruby-gimme, ruby-standard, ruby-rubocop-ast, ruby-rexml, ruby-range-compressor, ruby-regexp-property-values, ruby-regexp-parser, ruby-rubocop, ruby-pdf-reader, ruby-pdf-inspector, ruby-prawn), * gnu/packages/syncthing.scm (syncthing-gtk), * gnu/packages/video.scm (svt-hevc, mediasdk, libvideogfx, libde265, tslib), * gnu/packages/xml.scm (libxmlb, libxmlplusplus)[source]: Same. Efraim Flashner 2020-10-13gnu: Remove redundant MariaDB inputs....For well-behaved build systems, including the "dev" output suffices. * gnu/packages/bioinformatics.scm (kentutils)[inputs]: Remove MARIADB:LIB. * gnu/packages/cran.scm (r-rmysql)[inputs]: Likewise. * gnu/packages/databases.scm (python-mysqlclient, soci)[inputs]: Likewise. * gnu/packages/qt.scm (qt-4, qtbase): Likewise. * gnu/packages/ruby.scm (ruby-mysql2)[inputs]: Likewise. Marius Bakke 2020-09-05Merge remote-tracking branch 'origin/master' into stagingEfraim Flashner 2020-08-11gnu: qtserialbus: Add libsocketcan support....* gnu/packages/qt.scm (qtserialbus)[inputs]: Add libsocketcan. [phases]{patch-libsocketcan-reference}: Add phase. Maxim Cournoyer 2020-08-05gnu: qtbase: Provide debug symbols....* gnu/packages/qt.scm (qtbase)[outputs]: Add "debug". [arguments]: Add "-force-debug-info" to configure flags. Jakub Kądziołka 2020-08-01gnu: qtimageformats: Fix build....Reported by <nefix> on IRC. * gnu/packages/qt.scm (qtimageformats)[arguments]: Add a 'fix-build phase. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> Michael Rohleder 2020-07-28gnu: Update copyright....* gnu/packages/qt.scm: Update copyright. Nicolas Goaziou 2020-07-27gnu: qtspell: Add missing module.Nicolas Goaziou 2020-07-27gnu: Add qtspell....* gnu/packages/qt.scm (qtspell): New variable. Nicolas Goaziou