@makano/rew 1.1.73 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/coffeescript/browser.js +144 -139
- package/lib/coffeescript/cake.js +132 -133
- package/lib/coffeescript/coffeescript.js +437 -381
- package/lib/coffeescript/command.js +806 -724
- package/lib/coffeescript/grammar.js +1908 -2474
- package/lib/coffeescript/helpers.js +509 -473
- package/lib/coffeescript/index.js +228 -215
- package/lib/coffeescript/lexer.js +2282 -1909
- package/lib/coffeescript/nodes.js +9782 -9202
- package/lib/coffeescript/optparse.js +255 -227
- package/lib/coffeescript/parser.js +20305 -1265
- package/lib/coffeescript/register.js +107 -87
- package/lib/coffeescript/repl.js +307 -284
- package/lib/coffeescript/rewriter.js +1389 -1079
- package/lib/coffeescript/scope.js +176 -172
- package/lib/coffeescript/sourcemap.js +242 -227
- package/lib/rew/cli/cli.js +288 -186
- package/lib/rew/cli/log.js +31 -32
- package/lib/rew/cli/run.js +10 -12
- package/lib/rew/cli/utils.js +344 -176
- package/lib/rew/const/config_path.js +4 -0
- package/lib/rew/const/default.js +38 -35
- package/lib/rew/const/files.js +9 -9
- package/lib/rew/const/opt.js +8 -8
- package/lib/rew/css/theme.css +2 -2
- package/lib/rew/functions/core.js +55 -57
- package/lib/rew/functions/curl.js +23 -0
- package/lib/rew/functions/emitter.js +52 -55
- package/lib/rew/functions/exec.js +25 -21
- package/lib/rew/functions/export.js +18 -20
- package/lib/rew/functions/fs.js +55 -54
- package/lib/rew/functions/future.js +29 -21
- package/lib/rew/functions/id.js +8 -9
- package/lib/rew/functions/import.js +107 -93
- package/lib/rew/functions/map.js +13 -16
- package/lib/rew/functions/match.js +35 -26
- package/lib/rew/functions/path.js +8 -8
- package/lib/rew/functions/require.js +32 -33
- package/lib/rew/functions/sleep.js +2 -2
- package/lib/rew/functions/stdout.js +20 -20
- package/lib/rew/functions/types.js +96 -95
- package/lib/rew/html/ui.html +12 -13
- package/lib/rew/html/ui.js +205 -168
- package/lib/rew/main.js +14 -14
- package/lib/rew/misc/bin.js +37 -0
- package/lib/rew/misc/findAppInfo.js +16 -0
- package/lib/rew/misc/findAppPath.js +21 -0
- package/lib/rew/misc/req.js +7 -0
- package/lib/rew/misc/seededid.js +13 -0
- package/lib/rew/models/enum.js +12 -12
- package/lib/rew/models/struct.js +30 -32
- package/lib/rew/modules/compiler.js +237 -177
- package/lib/rew/modules/context.js +35 -22
- package/lib/rew/modules/fs.js +10 -10
- package/lib/rew/modules/runtime.js +17 -21
- package/lib/rew/modules/yaml.js +27 -30
- package/lib/rew/pkgs/conf.js +82 -75
- package/lib/rew/pkgs/data.js +12 -7
- package/lib/rew/pkgs/date.js +27 -28
- package/lib/rew/pkgs/env.js +6 -8
- package/lib/rew/pkgs/modules/data/bintree.js +52 -52
- package/lib/rew/pkgs/modules/data/doublylinked.js +85 -85
- package/lib/rew/pkgs/modules/data/linkedList.js +73 -73
- package/lib/rew/pkgs/modules/data/queue.js +19 -20
- package/lib/rew/pkgs/modules/data/stack.js +19 -19
- package/lib/rew/pkgs/modules/threads/worker.js +36 -26
- package/lib/rew/pkgs/modules/ui/classes.js +182 -178
- package/lib/rew/pkgs/pkgs.js +9 -10
- package/lib/rew/pkgs/rune.js +400 -0
- package/lib/rew/pkgs/threads.js +57 -53
- package/lib/rew/pkgs/ui.js +148 -136
- package/lib/rew/qrew/compile.js +12 -0
- package/package.json +11 -4
@@ -1,217 +1,230 @@
|
|
1
1
|
// Generated by CoffeeScript 2.7.0
|
2
|
-
(function() {
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
2
|
+
(function () {
|
3
|
+
// Node.js Implementation
|
4
|
+
var CoffeeScript,
|
5
|
+
ext,
|
6
|
+
fs,
|
7
|
+
helpers,
|
8
|
+
i,
|
9
|
+
len,
|
10
|
+
path,
|
11
|
+
ref,
|
12
|
+
universalCompile,
|
13
|
+
vm,
|
14
|
+
hasProp = {}.hasOwnProperty;
|
15
|
+
|
16
|
+
CoffeeScript = require('./coffeescript');
|
17
|
+
|
18
|
+
fs = require('fs');
|
19
|
+
|
20
|
+
vm = require('vm');
|
21
|
+
|
22
|
+
path = require('path');
|
23
|
+
|
24
|
+
helpers = CoffeeScript.helpers;
|
25
|
+
|
26
|
+
CoffeeScript.transpile = function (js, options) {
|
27
|
+
var babel;
|
28
|
+
try {
|
29
|
+
babel = require('@babel/core');
|
30
|
+
} catch (error) {
|
31
|
+
try {
|
32
|
+
babel = require('babel-core');
|
33
|
+
} catch (error) {
|
34
|
+
// This error is only for Node, as CLI users will see a different error
|
35
|
+
// earlier if they don’t have Babel installed.
|
36
|
+
throw new Error("To use the transpile option, you must have the '@babel/core' module installed");
|
37
|
+
}
|
38
|
+
}
|
39
|
+
return babel.transform(js, options);
|
40
|
+
};
|
41
|
+
|
42
|
+
// The `compile` method shared by the CLI, Node and browser APIs.
|
43
|
+
universalCompile = CoffeeScript.compile;
|
44
|
+
|
45
|
+
// The `compile` method particular to the Node API.
|
46
|
+
CoffeeScript.compile = function (code, options) {
|
47
|
+
// Pass a reference to Babel into the compiler, so that the transpile option
|
48
|
+
// is available in the Node API. We need to do this so that tools like Webpack
|
49
|
+
// can `require('coffeescript')` and build correctly, without trying to
|
50
|
+
// require Babel.
|
51
|
+
if (options != null ? options.transpile : void 0) {
|
52
|
+
options.transpile.transpile = CoffeeScript.transpile;
|
53
|
+
}
|
54
|
+
return universalCompile.call(CoffeeScript, code, options);
|
55
|
+
};
|
56
|
+
|
57
|
+
// Compile and execute a string of CoffeeScript (on the server), correctly
|
58
|
+
// setting `__filename`, `__dirname`, and relative `require()`.
|
59
|
+
CoffeeScript.run = function (code, options = {}) {
|
60
|
+
var answer, dir, mainModule, ref;
|
61
|
+
mainModule = require.main;
|
62
|
+
// Set the filename.
|
63
|
+
mainModule.filename = process.argv[1] = options.filename ? fs.realpathSync(options.filename) : helpers.anonymousFileName();
|
64
|
+
// Clear the module cache.
|
65
|
+
mainModule.moduleCache && (mainModule.moduleCache = {});
|
66
|
+
// Assign paths for node_modules loading
|
67
|
+
dir = options.filename != null ? path.dirname(fs.realpathSync(options.filename)) : fs.realpathSync('.');
|
68
|
+
mainModule.paths = require('module')._nodeModulePaths(dir);
|
69
|
+
// Save the options for compiling child imports.
|
70
|
+
mainModule.options = options;
|
71
|
+
options.filename = mainModule.filename;
|
72
|
+
options.inlineMap = true;
|
73
|
+
// Compile.
|
74
|
+
answer = CoffeeScript.compile(code, options);
|
75
|
+
code = (ref = answer.js) != null ? ref : answer;
|
76
|
+
return mainModule._compile(code, mainModule.filename);
|
77
|
+
};
|
78
|
+
|
79
|
+
// Compile and evaluate a string of CoffeeScript (in a Node.js-like environment).
|
80
|
+
// The CoffeeScript REPL uses this to run the input.
|
81
|
+
CoffeeScript.eval = function (code, options = {}) {
|
82
|
+
var Module, _module, _require, createContext, i, isContext, js, k, len, o, r, ref, ref1, ref2, ref3, sandbox, v;
|
83
|
+
if (!(code = code.trim())) {
|
84
|
+
return;
|
85
|
+
}
|
86
|
+
createContext = (ref = vm.Script.createContext) != null ? ref : vm.createContext;
|
87
|
+
isContext =
|
88
|
+
(ref1 = vm.isContext) != null
|
89
|
+
? ref1
|
90
|
+
: function (ctx) {
|
91
|
+
return options.sandbox instanceof createContext().constructor;
|
92
|
+
};
|
93
|
+
if (createContext) {
|
94
|
+
if (options.sandbox != null) {
|
95
|
+
if (isContext(options.sandbox)) {
|
96
|
+
sandbox = options.sandbox;
|
97
|
+
} else {
|
98
|
+
sandbox = createContext();
|
99
|
+
ref2 = options.sandbox;
|
100
|
+
for (k in ref2) {
|
101
|
+
if (!hasProp.call(ref2, k)) continue;
|
102
|
+
v = ref2[k];
|
103
|
+
sandbox[k] = v;
|
104
|
+
}
|
105
|
+
}
|
106
|
+
sandbox.global = sandbox.root = sandbox.GLOBAL = sandbox;
|
107
|
+
} else {
|
108
|
+
sandbox = global;
|
109
|
+
}
|
110
|
+
sandbox.__filename = options.filename || 'eval';
|
111
|
+
sandbox.__dirname = path.dirname(sandbox.__filename);
|
112
|
+
// define module/require only if they chose not to specify their own
|
113
|
+
if (!(sandbox !== global || sandbox.module || sandbox.require)) {
|
114
|
+
Module = require('module');
|
115
|
+
sandbox.module = _module = new Module(options.modulename || 'eval');
|
116
|
+
sandbox.require = _require = function (path) {
|
117
|
+
return Module._load(path, _module, true);
|
118
|
+
};
|
119
|
+
_module.filename = sandbox.__filename;
|
120
|
+
ref3 = Object.getOwnPropertyNames(require);
|
121
|
+
for (i = 0, len = ref3.length; i < len; i++) {
|
122
|
+
r = ref3[i];
|
123
|
+
if (r !== 'paths' && r !== 'arguments' && r !== 'caller') {
|
124
|
+
_require[r] = require[r];
|
125
|
+
}
|
126
|
+
}
|
127
|
+
// use the same hack node currently uses for their own REPL
|
128
|
+
_require.paths = _module.paths = Module._nodeModulePaths(process.cwd());
|
129
|
+
_require.resolve = function (request) {
|
130
|
+
return Module._resolveFilename(request, _module);
|
131
|
+
};
|
132
|
+
}
|
133
|
+
}
|
134
|
+
o = {};
|
135
|
+
for (k in options) {
|
136
|
+
if (!hasProp.call(options, k)) continue;
|
137
|
+
v = options[k];
|
138
|
+
o[k] = v;
|
139
|
+
}
|
140
|
+
o.bare = true; // ensure return value
|
141
|
+
js = CoffeeScript.compile(code, o);
|
142
|
+
if (sandbox === global) {
|
143
|
+
return vm.runInThisContext(js);
|
144
|
+
} else {
|
145
|
+
return vm.runInContext(js, sandbox);
|
146
|
+
}
|
147
|
+
};
|
148
|
+
|
149
|
+
CoffeeScript.register = function () {
|
150
|
+
return require('./register');
|
151
|
+
};
|
152
|
+
|
153
|
+
// Throw error with deprecation warning when depending upon implicit `require.extensions` registration
|
154
|
+
if (require.extensions) {
|
155
|
+
ref = CoffeeScript.FILE_EXTENSIONS;
|
156
|
+
for (i = 0, len = ref.length; i < len; i++) {
|
157
|
+
ext = ref[i];
|
158
|
+
(function (ext) {
|
159
|
+
var base;
|
160
|
+
return (base = require.extensions)[ext] != null
|
161
|
+
? base[ext]
|
162
|
+
: (base[ext] = function () {
|
163
|
+
throw new Error(`Use CoffeeScript.register() or require the coffeescript/register module to require ${ext} files.`);
|
164
|
+
});
|
165
|
+
})(ext);
|
166
|
+
}
|
167
|
+
}
|
168
|
+
|
169
|
+
CoffeeScript._compileRawFileContent = function (raw, filename, options = {}) {
|
170
|
+
var answer, err, stripped;
|
171
|
+
// Strip the Unicode byte order mark, if this file begins with one.
|
172
|
+
stripped = raw.charCodeAt(0) === 0xfeff ? raw.substring(1) : raw;
|
173
|
+
options = Object.assign({}, options, {
|
174
|
+
filename: filename,
|
175
|
+
literate: helpers.isLiterate(filename),
|
176
|
+
sourceFiles: [filename],
|
177
|
+
});
|
178
|
+
try {
|
179
|
+
answer = CoffeeScript.compile(stripped, options);
|
180
|
+
} catch (error) {
|
181
|
+
err = error;
|
182
|
+
// As the filename and code of a dynamically loaded file will be different
|
183
|
+
// from the original file compiled with CoffeeScript.run, add that
|
184
|
+
// information to error so it can be pretty-printed later.
|
185
|
+
throw helpers.updateSyntaxError(err, stripped, filename);
|
186
|
+
}
|
187
|
+
return answer;
|
188
|
+
};
|
189
|
+
|
190
|
+
CoffeeScript._compileFile = function (filename, options = {}) {
|
191
|
+
var raw;
|
192
|
+
raw = fs.readFileSync(filename, 'utf8');
|
193
|
+
return CoffeeScript._compileRawFileContent(raw, filename, options);
|
194
|
+
};
|
195
|
+
|
196
|
+
module.exports = CoffeeScript;
|
197
|
+
|
198
|
+
// Explicitly define all named exports so that Node’s automatic detection of
|
199
|
+
// named exports from CommonJS packages finds all of them. This enables consuming
|
200
|
+
// packages to write code like `import { compile } from 'coffeescript'`.
|
201
|
+
// Don’t simplify this into a loop or similar; the `module.exports.name` part is
|
202
|
+
// essential for Node’s algorithm to successfully detect the name.
|
203
|
+
module.exports.VERSION = CoffeeScript.VERSION;
|
204
|
+
|
205
|
+
module.exports.FILE_EXTENSIONS = CoffeeScript.FILE_EXTENSIONS;
|
206
|
+
|
207
|
+
module.exports.helpers = CoffeeScript.helpers;
|
208
|
+
|
209
|
+
module.exports.registerCompiled = CoffeeScript.registerCompiled;
|
210
|
+
|
211
|
+
module.exports.compile = CoffeeScript.compile;
|
212
|
+
|
213
|
+
module.exports.tokens = CoffeeScript.tokens;
|
214
|
+
|
215
|
+
module.exports.nodes = CoffeeScript.nodes;
|
216
|
+
|
217
|
+
module.exports.register = CoffeeScript.register;
|
218
|
+
|
219
|
+
module.exports.eval = CoffeeScript.eval;
|
220
|
+
|
221
|
+
module.exports.run = CoffeeScript.run;
|
222
|
+
|
223
|
+
module.exports.transpile = CoffeeScript.transpile;
|
224
|
+
|
225
|
+
module.exports.patchStackTrace = CoffeeScript.patchStackTrace;
|
226
|
+
|
227
|
+
module.exports._compileRawFileContent = CoffeeScript._compileRawFileContent;
|
228
|
+
|
229
|
+
module.exports._compileFile = CoffeeScript._compileFile;
|
217
230
|
}).call(this);
|