aboutsummaryrefslogtreecommitdiff
/***********************************************************************

  A JavaScript tokenizer / parser / beautifier / compressor.
  https://github.com/mishoo/UglifyJS

  -------------------------------- (C) ---------------------------------

                           Author: Mihai Bazon
                         <mihai.bazon@gmail.com>
                       http://mihai.bazon.net/blog

  Distributed under the BSD license:

    Copyright 2012 (c) Mihai Bazon <mihai.bazon@gmail.com>

    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions
    are met:

        * Redistributions of source code must retain the above
          copyright notice, this list of conditions and the following
          disclaimer.

        * Redistributions in binary form must reproduce the above
          copyright notice, this list of conditions and the following
          disclaimer in the documentation and/or other materials
          provided with the distribution.

    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER “AS IS” AND ANY
    EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE
    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
    OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
    PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
    THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
    TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
    THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
    SUCH DAMAGE.

 ***********************************************************************/

"use strict";

var vlq_char = characters("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/");
var vlq_bits = vlq_char.reduce(function(map, ch, bits) {
    map[ch] = bits;
    return map;
}, Object.create(null));

function vlq_decode(indices, str) {
    var value = 0;
    var shift = 0;
    for (var i = 0, j = 0; i < str.length; i++) {
        var bits = vlq_bits[str[i]];
        value += (bits & 31) << shift;
        if (bits & 32) {
            shift += 5;
        } else {
            indices[j++] += value & 1 ? 0x80000000 | -(value >> 1) : value >> 1;
            value = shift = 0;
        }
    }
    return j;
}

function vlq_encode(num) {
    var result = "";
    num = Math.abs(num) << 1 | num >>> 31;
    do {
        var bits = num & 31;
        if (num >>>= 5) bits |= 32;
        result += vlq_char[bits];
    } while (num);
    return result;
}

function create_array_map() {
    var map = Object.create(null);
    var array = [];
    array.index = function(name) {
        if (!HOP(map, name)) {
            map[name] = array.length;
            array.push(name);
        }
        return map[name];
    };
    return array;
}

function SourceMap(options) {
    var sources = create_array_map();
    var sources_content = options.includeSources && Object.create(null);
    var names = create_array_map();
    var mappings = "";
    if (options.orig) Object.keys(options.orig).forEach(function(name) {
        var map = options.orig[name];
        var indices = [ 0, 0, 1, 0, 0 ];
        options.orig[name] = {
            names: map.names,
            mappings: map.mappings.split(/;/).map(function(line) {
                indices[0] = 0;
                return line.split(/,/).map(function(segment) {
                    return indices.slice(0, vlq_decode(indices, segment));
                });
            }),
            sources: map.sources,
        };
        if (!sources_content || !map.sourcesContent) return;
        for (var i = 0; i < map.sources.length; i++) {
            var content = map.sourcesContent[i];
            if (content) sources_content[map.sources[i]] = content;
        }
    });
    var prev_source;
    var generated_line = 1;
    var generated_column = 0;
    var source_index = 0;
    var original_line = 1;
    var original_column = 0;
    var name_index = 0;
    return {
        add: options.orig ? function(source, gen_line, gen_col, orig_line, orig_col, name) {
            var map = options.orig[source];
            if (map) {
                var segments = map.mappings[orig_line - 1];
                if (!segments) return;
                var indices;
                for (var i = 0; i < segments.length; i++) {
                    var col = segments[i][0];
                    if (orig_col >= col) indices = segments[i];
                    if (orig_col <= col) break;
                }
                if (!indices || indices.length < 4) {
                    source = null;
                } else {
                    source = map.sources[indices[1]];
                    orig_line = indices[2];
                    orig_col = indices[3];
                    if (indices.length > 4) name = map.names[indices[4]];
                }
            }
            add(source, gen_line, gen_col, orig_line, orig_col, name);
        } : add,
        setSourceContent: sources_content ? function(source, content) {
            if (!(source in sources_content)) {
                sources_content[source] = content;
            }
        } : noop,
        toString: function() {
            return JSON.stringify({
                version: 3,
                file: options.filename || undefined,
                sourceRoot: options.root || undefined,
                sources: sources,
                sourcesContent: sources_content ? sources.map(function(source) {
                    return sources_content[source] || null;
                }) : undefined,
                names: names,
                mappings: mappings,
            });
        }
    };

    function add(source, gen_line, gen_col, orig_line, orig_col, name) {
        if (prev_source == null && source == null) return;
        prev_source = source;
        if (generated_line < gen_line) {
            generated_column = 0;
            do {
                mappings += ";";
            } while (++generated_line < gen_line);
        } else if (mappings) {
            mappings += ",";
        }
        mappings += vlq_encode(gen_col - generated_column);
        generated_column = gen_col;
        if (source == null) return;
        var src_idx = sources.index(source);
        mappings += vlq_encode(src_idx - source_index);
        source_index = src_idx;
        mappings += vlq_encode(orig_line - original_line);
        original_line = orig_line;
        mappings += vlq_encode(orig_col - original_column);
        original_column = orig_col;
        if (options.names && name != null) {
            var name_idx = names.index(name);
            mappings += vlq_encode(name_idx - name_index);
            name_index = name_idx;
        }
    }
}
nch 'master' into stagingMarius Bakke 2022-09-04gnu: f3d: Update to 1.3.0-pre-0.46df21f....* gnu/packages/graphics.scm (f3d): Update to 1.3.0-pre-0.46df21f. [source](modules, snippet): New fields. [arguments]<#:configure-flags>: Generate manual page, install various resource files, and enable the now-optional external rendering feature. [native-inputs]: New field. [synopsis]: Add hyphen. [description]: Reword. Signed-off-by: Christopher Baines <mail@cbaines.net> Paul A. Patience 2022-09-03gnu: directfb: Use librsvg-for-system....* gnu/packages/graphics.scm (directfb)[inputs]: Replace librsvg with librsvg-for-system. Efraim Flashner 2022-09-02gnu: openexr@2: Skip failing test on i686....* gnu/packages/graphics.scm (openexr-2)[arguments]: In 'disable-broken-test', skip 'testCompression' as well. Ludovic Courtès 2022-09-02gnu: imath: Skip tests on i686....* gnu/packages/graphics.scm (imath)[arguments]: New field. Ludovic Courtès 2022-09-01gnu: ilmbase: Skip failing test on i686-linux....* gnu/packages/graphics.scm (ilmbase)[arguments]: Add 'skip-test' phase. Ludovic Courtès 2022-09-01gnu: ilmbase: Switch to gexps....* gnu/packages/graphics.scm (ilmbase)[arguments]: Use a gexp. Ludovic Courtès 2022-08-30gnu: Add mmg....* gnu/packages/graphics.scm (mmg): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Paul A. Patience 2022-08-14gnu: Remove ‘open source’ from package descriptions....Also do some (trivial) editing where appropriate. * gnu/packages/bioconductor.scm (r-anaquin, r-rcppnumerical) [description]: Remove superfluous ‘open source’. * gnu/packages/debian.scm (apt-mirror)[description]: Likewise. Add @acronym{}. Drop obscure Ubuntu for famous Trisquel. Reorder. * gnu/packages/documentation.scm (scrollkeeper)[description]: Remove superfluous ‘open systems’. Keep ‘Open Source’ in standard name. * gnu/packages/engineering.scm (freecad, cura-engine)[description]: Remove superfluous ‘open source’ and excessive puffery. * gnu/packages/firmware.scm (make-opensbi-package) [synopsis]: Remove ‘Open Source’. Use @acronym{}. [description]: Fix first sentence to follow guidelines. Use @acronym{}. * gnu/packages/game-development.scm (ioquake3, recastnavigation): [description]: Remove ‘open source’. * gnu/packages/graphics.scm (skia)[description]: Likewise. * gnu/packages/lisp-xyz.scm (sbcl-s-sysdeps)[description]: Likewise. * gnu/packages/machine-learning.scm (onnx)[description]: Likewise. Use @acronym{}. * gnu/packages/ocaml.scm (ocaml-cudf)[description]: Likewise. Tobias Geerinckx-Rice 2022-08-19gnu: directfb: Remove timestamp to build reproducibly....* gnu/packages/graphics.scm (directfb)[arguments]: Add 'remove-buildtime phase. Vagrant Cascadian 2022-08-16gnu: python-booleanoperations: Add missing input....* gnu/packages/graphics.scm (python-booleanoperations)[native-inputs]: Add PYTHON-SETUPTOOLS-SCM. Marius Bakke 2022-08-13gnu: openxr: Update to 1.0.24....* gnu/packages/graphics.scm (openxr): Update to 1.0.24. Vinicius Monego 2022-08-11gnu: Add f3d....* gnu/packages/graphics.scm (f3d): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> Paul A. Patience 2022-08-04gnu: inkscape: Build with lib2geom 1.2....* gnu/packages/graphics.scm (lib2geom-1.2): New variable. * gnu/packages/inkscape.scm (inkscape)[arguments]: Enable previously failing test. [inputs]: Replace "lib2geom" with LIB2GEOM-1.2. Marius Bakke 2022-08-03gnu: Add mikktspace....* gnu/packages/graphics.scm (mikktspace): New variable. Signed-off-by: 宋文武 <iyzsong@member.fsf.org> John Kehayias 2022-07-31gnu: qttools: Rename to qttools-5....Automated with: git grep -l qttools | xargs sed 's/\bqttools\b/\0-5/g' -i git checkout NEWS Maxim Cournoyer 2022-07-31gnu: qtmultimedia: Rename to qtmultimedia-5....Automated via: git grep -l qtmultimedia | xargs sed 's/qtmultimedia/qtmultimedia-5/g' -i git checkout NEWS Maxim Cournoyer 2022-07-31gnu: qtsvg: Rename variable to qtsvg-5....This is in preparation of the qtsvg update to version 6. This change was automated via the following command: git grep -l '\bqtsvg\b' | xargs sed 's/qtsvg/qtsvg-5/g' -i Maxim Cournoyer 2022-06-24gnu: Add azpainter....* gnu/packages/graphics.scm (azpainter): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Tobias Kortkamp 2022-06-18gnu: openxr: Update to 1.0.23....* gnu/packages/graphics.scm (openxr): Update to 1.0.23. Vinicius Monego 2022-05-31gnu: Remove rapicorn....* gnu/packages/graphics.scm (rapicorn): Delete variable. * gnu/packages/patches/rapicorn-isnan.patch: Remove patch. * gnu/local.mk (dist_patch_DATA): De-register it. Maxim Cournoyer 2022-05-31gnu: Remove python2-pastel....* gnu/packages/graphics.scm (python2-pastel): Delete variable. Maxim Cournoyer 2022-05-12gnu: Add skia....* gnu/packages/graphics.scm (skia): New variable. Maxim Cournoyer 2022-05-12gnu: Add python-booleanoperations....* gnu/packages/graphics.scm (python-booleanoperations): New variable. Maxim Cournoyer 2022-05-09gnu: mangohud: Update to 0.6.7....* gnu/packages/graphics.scm (mangohud): Update to 0.6.7. [phases]{patch-paths}: Remove loader_libdrm.cpp path patch as the file has been removed. [inputs]: Remove libdrm input, no longer needed. Signed-off-by: Mathieu Othacehe <othacehe@gnu.org> John Kehayias 2022-03-19gnu: assimp: Update to 5.2.2....Message-Id: <ccbfd879e41c5c0bbeee965c363e48b08b7750d0.1647174270.git.873216071@qq.com> From: Z572 <873216071@qq.com> Date: Sun, 13 Mar 2022 20:19:48 +0800 Subject: [PATCH] gnu: assimp: Update to 5.2.2. * gnu/packages/graphics.scm (assimp): Update to 5.2.2. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Z572 2022-03-08gnu: blender: Enable boolean operations on meshes....* gnu/packages/graphics.scm (blender)[inputs]: Add gmp. Signed-off-by: Guillaume Le Vaillant <glv@posteo.net> raingloom 2022-02-26gnu: Add mangohud....* gnu/packages/graphics.scm (mangohud): New variable. Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com> John Kehayias 2022-02-21gnu: dear-imgui: Delete package, preferring the newer 'imgui'....Commit 1a4cc954d2fcea172a450ae03419b7fdda28b81e added imgui, without noticing about the pre-existing 'dear-imgui' package. * gnu/packages/graphics.scm (dear-imgui): Delete variable, but salvage the superior synopsis and description to... * gnu/packages/toolkits.scm (imgui): ... here. Maxim Cournoyer 2022-02-21gnu: ogre: Update to 13.3.1....* gnu/packages/graphics.scm (ogre): Update to 13.3.1. [phases]: Delete trailing #t. {unpack-dear-imgui}: Rename to... {unpack-imgui}: ... this. [configure-flags]: Adjust accordingly. [native-inputs]: Delete boost. Use the newer imgui-1.86 package instead of dear-imgui. Use the current googletest package. Add python. [inputs]: Remove font-dejavu, glu, tinyxml and zziplib. Add libxt, mesa and zlib. Maxim Cournoyer