Current Dev State

This commit is contained in:
Tim Lorsbach
2025-06-23 20:13:54 +02:00
parent b4f9bb277d
commit ded50edaa2
22617 changed files with 4345095 additions and 174 deletions

18
static/js/ketcher2/node_modules/astw/LICENSE generated vendored Normal file
View File

@ -0,0 +1,18 @@
This software is released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View File

@ -0,0 +1,8 @@
var astw = require('../');
var deparse = require('escodegen').generate;
var walk = astw('4 + beep(5 * 2)');
walk(function (node) {
var src = deparse(node);
console.log(node.type + ' :: ' + JSON.stringify(src));
});

52
static/js/ketcher2/node_modules/astw/index.js generated vendored Normal file
View File

@ -0,0 +1,52 @@
var parse = require('acorn').parse;
module.exports = function (src, opts) {
if (!opts) opts = {}
var ast = src;
if (typeof src === 'string') {
try {
ast = parse(src, {
ecmaVersion: opts.ecmaVersion || 8,
allowReturnOutsideFunction: true
})
}
catch (err) { ast = parse('(' + src + ')') }
}
return function (cb) {
walk(ast, undefined, cb);
};
};
function walk (node, parent, cb) {
var keys = objectKeys(node);
for (var i = 0; i < keys.length; i++) {
var key = keys[i];
if (key === 'parent') continue;
var child = node[key];
if (isArray(child)) {
for (var j = 0; j < child.length; j++) {
var c = child[j];
if (c && typeof c.type === 'string') {
c.parent = node;
walk(c, node, cb);
}
}
}
else if (child && typeof child.type === 'string') {
child.parent = node;
walk(child, node, cb);
}
}
cb(node);
}
var isArray = Array.isArray || function (xs) {
return Object.prototype.toString.call(xs) === '[object Array]';
};
var objectKeys = Object.keys || function (obj) {
var keys = [];
for (var key in obj) keys.push(key);
return keys;
};

73
static/js/ketcher2/node_modules/astw/package.json generated vendored Normal file
View File

@ -0,0 +1,73 @@
{
"_from": "astw@^2.0.0",
"_id": "astw@2.2.0",
"_inBundle": false,
"_integrity": "sha1-e9QXhNMkk5h66yOba04cV6hzuRc=",
"_location": "/astw",
"_phantomChildren": {},
"_requested": {
"type": "range",
"registry": true,
"raw": "astw@^2.0.0",
"name": "astw",
"escapedName": "astw",
"rawSpec": "^2.0.0",
"saveSpec": null,
"fetchSpec": "^2.0.0"
},
"_requiredBy": [
"/lexical-scope"
],
"_resolved": "https://registry.npmjs.org/astw/-/astw-2.2.0.tgz",
"_shasum": "7bd41784d32493987aeb239b6b4e1c57a873b917",
"_spec": "astw@^2.0.0",
"_where": "/home/manfred/enviPath/ketcher2/ketcher/node_modules/lexical-scope",
"author": {
"name": "James Halliday",
"email": "mail@substack.net",
"url": "http://substack.net"
},
"bugs": {
"url": "https://github.com/substack/astw/issues"
},
"bundleDependencies": false,
"dependencies": {
"acorn": "^4.0.3"
},
"deprecated": false,
"description": "walk the ast with references to parent nodes",
"devDependencies": {
"escodegen": "~0.0.17",
"tape": "~2.4.1"
},
"homepage": "https://github.com/substack/astw",
"keywords": [
"ast",
"walk",
"source",
"acorn"
],
"license": "MIT",
"main": "index.js",
"name": "astw",
"repository": {
"type": "git",
"url": "git://github.com/substack/astw.git"
},
"scripts": {
"test": "tape test/*.js"
},
"testling": {
"files": "test/*.js",
"browsers": [
"ie/6..latest",
"chrome/20..latest",
"firefox/10..latest",
"safari/latest",
"opera/11.0..latest",
"iphone/6",
"ipad/6"
]
},
"version": "2.2.0"
}

56
static/js/ketcher2/node_modules/astw/readme.markdown generated vendored Normal file
View File

@ -0,0 +1,56 @@
# astw
walk the ast
[![browser support](http://ci.testling.com/substack/astw.png)](http://ci.testling.com/substack/astw)
[![build status](https://secure.travis-ci.org/substack/astw.png)](http://travis-ci.org/substack/astw)
This module is a faster version of
[falafel](https://github.com/substack/node-falafel)
that only does ast walking and `.parent` tracking, not source transforms.
# example
``` js
var astw = require('astw');
var deparse = require('escodegen').generate;
var walk = astw('4 + beep(5 * 2)');
walk(function (node) {
var src = deparse(node);
console.log(node.type + ' :: ' + JSON.stringify(src));
});
```
# methods
``` js
var astw = require('astw')
```
## var walk = astw(src, opts={})
Return a `walk()` function from the source string or ast object `src`.
Optionally:
* `opts.ecmaVersion` - default: 8
## walk(cb)
Walk the nodes in the ast with `cb(node)` where `node` is each element in the
ast from [esprima](http://esprima.org/) but with an additional `.parent`
reference to the parent node.
# install
With [npm](https://npmjs.org) do:
```
npm install astw
```
# license
MIT

13
static/js/ketcher2/node_modules/astw/test/json.js generated vendored Normal file
View File

@ -0,0 +1,13 @@
var astw = require('../');
var test = require('tape');
test('json', function (t) {
t.plan(2);
var numbers = [ 1, 2 ];
var walk = astw('{"a":1,"b":2}');
walk(function (node) {
if (node.type === 'Literal' && typeof node.value === 'number') {
t.equal(node.value, numbers.shift());
}
});
});

25
static/js/ketcher2/node_modules/astw/test/parent.js generated vendored Normal file
View File

@ -0,0 +1,25 @@
var astw = require('../');
var test = require('tape');
var generate = require('escodegen').generate;
function unparse (s) {
return generate(s, { format: { compact: true } });
}
test('parent', function (t) {
t.plan(4);
var walk = astw('(' + function () {
var xs = [ 1, 2, 3 ];
fn(ys);
} + ')()');
walk(function (node) {
if (node.type === 'ArrayExpression') {
t.equal(node.parent.type, 'VariableDeclarator');
t.equal(unparse(node.parent), 'xs=[1,2,3]');
t.equal(node.parent.parent.type, 'VariableDeclaration');
t.equal(unparse(node.parent.parent), 'var xs=[1,2,3];');
}
});
});