Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7684a19

Browse files
committed
update: 调整编译器代码结构
1 parent 8f7c81c commit 7684a19

File tree

6 files changed

+486
-332
lines changed

6 files changed

+486
-332
lines changed

‎compiler/nodejs/wcc‎

Lines changed: 446 additions & 283 deletions
Large diffs are not rendered by default.

‎compiler/nodejs/wcsc‎

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#!/usr/bin/env node
22
// wcsc.exe md5 = "3999c590c57c764b152bc6db3b3288c4"
3-
const version = "20220308"
3+
const version = "20220308";
44
const { spawn } = require("child_process");
55
const path = require("path");
66
const args = process.argv.slice(2);
7-
const wcscPath = path.resolve(__dirname, "./wcsc.bin")
7+
const wcscPath = path.resolve(__dirname, "./wcsc.bin");
88

99
function encode1(s) {
1010
return encodeURI(s).replace(
@@ -28,7 +28,9 @@ if (args.includes("-ll")) {
2828
});
2929
wcsc.on("close", (n) => {
3030
if (0 === n) {
31-
const str = Buffer.concat(spwanData).toString().replace(/\\\\/g, '\\\\u005c');
31+
const str = Buffer.concat(spwanData)
32+
.toString()
33+
.replace(/\\\\/g, "\\\\u005c");
3234
const resultSplit = encode1(str).split("=");
3335
const tempObj = {};
3436
for (
@@ -62,21 +64,20 @@ if (args.includes("-ll")) {
6264
result = result.replace(/\\\\/g, "\\");
6365
result = result.replace(/\\[\s\S]{1}/gi, function (0ドル, 1ドル, 2ドル) {
6466
const c = 0ドル === "\\n" ? "\n" : 0ドル[1];
65-
return "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0")
66-
})
67+
return "\\u" + c.charCodeAt(0).toString(16).padStart(4, "0");
68+
});
6769
process.stdout.write(result);
68-
}else{
70+
}else{
6971
process.stderr.write(Buffer.concat(errData).toString());
70-
process.exitCode = n
72+
process.exitCode = n;
7173
}
7274
});
73-
7475
} else {
7576
const wcsc = spawn(wcscPath, args, {
7677
cwd: process.cwd(),
7778
stdio: "inherit",
7879
});
79-
wcsc.on('close',code=>{
80-
process.exitCode = code
81-
})
80+
wcsc.on("close",(code)=>{
81+
process.exitCode = code;
82+
});
8283
}

‎compiler/test/wcc/lla/4/node_output.json‎

Lines changed: 7 additions & 14 deletions
Large diffs are not rendered by default.

‎compiler/test/wcc/lla/4/wine_output.json‎

Lines changed: 7 additions & 14 deletions
Large diffs are not rendered by default.

‎compiler/test/wcc/llw/4/node_output.json‎

Lines changed: 7 additions & 5 deletions
Large diffs are not rendered by default.

‎compiler/test/wcc/llw/4/wine_output.json‎

Lines changed: 7 additions & 5 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /