@danielx/civet 0.4.19-pre.6 → 0.4.19-pre.7
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/dist/browser.js +35 -9
- package/dist/civet +8 -2
- package/dist/main.js +35 -9
- package/package.json +1 -1
package/dist/browser.js
CHANGED
|
@@ -2406,14 +2406,24 @@ var Civet = (() => {
|
|
|
2406
2406
|
}
|
|
2407
2407
|
var Block$0 = $T($S(__, OpenBrace, EOS, NestedBlockStatements, __, CloseBrace), function(value) {
|
|
2408
2408
|
var exps = value[3];
|
|
2409
|
-
return { "type": "BlockStatement", "expressions": exps, "children": value };
|
|
2409
|
+
return { "type": "BlockStatement", "expressions": exps, "children": value, "bare": false };
|
|
2410
2410
|
});
|
|
2411
2411
|
var Block$1 = $T($S(InsertOpenBrace, EOS, NestedBlockStatements, InsertNewline, InsertIndent, InsertCloseBrace), function(value) {
|
|
2412
2412
|
var exps = value[2];
|
|
2413
|
-
return { "type": "BlockStatement", "expressions": exps, "children": value };
|
|
2413
|
+
return { "type": "BlockStatement", "expressions": exps, "children": value, "bare": false };
|
|
2414
2414
|
});
|
|
2415
2415
|
var Block$2 = ThenClause;
|
|
2416
|
-
var Block$3 = $S($Q(TrailingComment), Statement)
|
|
2416
|
+
var Block$3 = $TS($S($Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2) {
|
|
2417
|
+
var ws = $1;
|
|
2418
|
+
var s = $2;
|
|
2419
|
+
const expressions = [$0];
|
|
2420
|
+
return {
|
|
2421
|
+
type: "BlockStatement",
|
|
2422
|
+
expressions,
|
|
2423
|
+
children: [expressions],
|
|
2424
|
+
bare: true
|
|
2425
|
+
};
|
|
2426
|
+
});
|
|
2417
2427
|
function Block(state) {
|
|
2418
2428
|
if (state.tokenize) {
|
|
2419
2429
|
return $TOKEN("Block", state, Block$0(state) || Block$1(state) || Block$2(state) || Block$3(state));
|
|
@@ -2421,8 +2431,16 @@ var Civet = (() => {
|
|
|
2421
2431
|
return Block$0(state) || Block$1(state) || Block$2(state) || Block$3(state);
|
|
2422
2432
|
}
|
|
2423
2433
|
}
|
|
2424
|
-
var ThenClause$0 = $
|
|
2425
|
-
|
|
2434
|
+
var ThenClause$0 = $TS($S(Then, $Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2, $3) {
|
|
2435
|
+
var ws = $2;
|
|
2436
|
+
var s = $3;
|
|
2437
|
+
const expressions = [[ws, s]];
|
|
2438
|
+
return {
|
|
2439
|
+
type: "BlockStatement",
|
|
2440
|
+
expressions,
|
|
2441
|
+
children: [expressions],
|
|
2442
|
+
bare: true
|
|
2443
|
+
};
|
|
2426
2444
|
});
|
|
2427
2445
|
function ThenClause(state) {
|
|
2428
2446
|
if (state.verbose)
|
|
@@ -4077,10 +4095,18 @@ var Civet = (() => {
|
|
|
4077
4095
|
var expressions = value[2];
|
|
4078
4096
|
return { "type": "CaseClause", "cases": cases, "expressions": expressions, "children": value };
|
|
4079
4097
|
});
|
|
4080
|
-
var CaseClause$1 = $
|
|
4081
|
-
var cases =
|
|
4082
|
-
var expressions =
|
|
4083
|
-
|
|
4098
|
+
var CaseClause$1 = $TS($S(When, CaseExpressionList, $C(ThenClause, NestedBlockStatements), InsertBreak), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
4099
|
+
var cases = $2;
|
|
4100
|
+
var expressions = $3;
|
|
4101
|
+
if (expressions.expressions) {
|
|
4102
|
+
expressions = expressions.expressions;
|
|
4103
|
+
}
|
|
4104
|
+
return {
|
|
4105
|
+
type: "WhenClause",
|
|
4106
|
+
cases,
|
|
4107
|
+
expressions,
|
|
4108
|
+
children: $0
|
|
4109
|
+
};
|
|
4084
4110
|
});
|
|
4085
4111
|
var CaseClause$2 = $T($S(Default, ImpliedColon, $C(NestedBlockStatements, NoExpressions)), function(value) {
|
|
4086
4112
|
var exps = value[2];
|
package/dist/civet
CHANGED
|
@@ -10,7 +10,13 @@ if (process.argv.includes("--version")) {
|
|
|
10
10
|
encoding = "utf8";
|
|
11
11
|
process.stdin.setEncoding(encoding);
|
|
12
12
|
fs = require("fs");
|
|
13
|
-
readline =
|
|
13
|
+
readline = function() {
|
|
14
|
+
try {
|
|
15
|
+
return require("node:readline");
|
|
16
|
+
} catch (error) {
|
|
17
|
+
return require("readline");
|
|
18
|
+
}
|
|
19
|
+
}();
|
|
14
20
|
readLines = function(rl) {
|
|
15
21
|
return new Promise(function(resolve, reject) {
|
|
16
22
|
var parts;
|
|
@@ -45,6 +51,6 @@ readLines(readline.createInterface(process.stdin)).then(function(input) {
|
|
|
45
51
|
output = compile(input, { filename, js, inlineMap });
|
|
46
52
|
return process.stdout.write(output);
|
|
47
53
|
}).catch(function(e) {
|
|
48
|
-
console.error(e
|
|
54
|
+
console.error(e);
|
|
49
55
|
return process.exit(1);
|
|
50
56
|
});
|
package/dist/main.js
CHANGED
|
@@ -2405,14 +2405,24 @@ var require_parser = __commonJS({
|
|
|
2405
2405
|
}
|
|
2406
2406
|
var Block$0 = $T($S(__, OpenBrace, EOS, NestedBlockStatements, __, CloseBrace), function(value) {
|
|
2407
2407
|
var exps = value[3];
|
|
2408
|
-
return { "type": "BlockStatement", "expressions": exps, "children": value };
|
|
2408
|
+
return { "type": "BlockStatement", "expressions": exps, "children": value, "bare": false };
|
|
2409
2409
|
});
|
|
2410
2410
|
var Block$1 = $T($S(InsertOpenBrace, EOS, NestedBlockStatements, InsertNewline, InsertIndent, InsertCloseBrace), function(value) {
|
|
2411
2411
|
var exps = value[2];
|
|
2412
|
-
return { "type": "BlockStatement", "expressions": exps, "children": value };
|
|
2412
|
+
return { "type": "BlockStatement", "expressions": exps, "children": value, "bare": false };
|
|
2413
2413
|
});
|
|
2414
2414
|
var Block$2 = ThenClause;
|
|
2415
|
-
var Block$3 = $S($Q(TrailingComment), Statement)
|
|
2415
|
+
var Block$3 = $TS($S($Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2) {
|
|
2416
|
+
var ws = $1;
|
|
2417
|
+
var s = $2;
|
|
2418
|
+
const expressions = [$0];
|
|
2419
|
+
return {
|
|
2420
|
+
type: "BlockStatement",
|
|
2421
|
+
expressions,
|
|
2422
|
+
children: [expressions],
|
|
2423
|
+
bare: true
|
|
2424
|
+
};
|
|
2425
|
+
});
|
|
2416
2426
|
function Block(state) {
|
|
2417
2427
|
if (state.tokenize) {
|
|
2418
2428
|
return $TOKEN("Block", state, Block$0(state) || Block$1(state) || Block$2(state) || Block$3(state));
|
|
@@ -2420,8 +2430,16 @@ var require_parser = __commonJS({
|
|
|
2420
2430
|
return Block$0(state) || Block$1(state) || Block$2(state) || Block$3(state);
|
|
2421
2431
|
}
|
|
2422
2432
|
}
|
|
2423
|
-
var ThenClause$0 = $
|
|
2424
|
-
|
|
2433
|
+
var ThenClause$0 = $TS($S(Then, $Q(TrailingComment), Statement), function($skip, $loc, $0, $1, $2, $3) {
|
|
2434
|
+
var ws = $2;
|
|
2435
|
+
var s = $3;
|
|
2436
|
+
const expressions = [[ws, s]];
|
|
2437
|
+
return {
|
|
2438
|
+
type: "BlockStatement",
|
|
2439
|
+
expressions,
|
|
2440
|
+
children: [expressions],
|
|
2441
|
+
bare: true
|
|
2442
|
+
};
|
|
2425
2443
|
});
|
|
2426
2444
|
function ThenClause(state) {
|
|
2427
2445
|
if (state.verbose)
|
|
@@ -4076,10 +4094,18 @@ var require_parser = __commonJS({
|
|
|
4076
4094
|
var expressions = value[2];
|
|
4077
4095
|
return { "type": "CaseClause", "cases": cases, "expressions": expressions, "children": value };
|
|
4078
4096
|
});
|
|
4079
|
-
var CaseClause$1 = $
|
|
4080
|
-
var cases =
|
|
4081
|
-
var expressions =
|
|
4082
|
-
|
|
4097
|
+
var CaseClause$1 = $TS($S(When, CaseExpressionList, $C(ThenClause, NestedBlockStatements), InsertBreak), function($skip, $loc, $0, $1, $2, $3, $4) {
|
|
4098
|
+
var cases = $2;
|
|
4099
|
+
var expressions = $3;
|
|
4100
|
+
if (expressions.expressions) {
|
|
4101
|
+
expressions = expressions.expressions;
|
|
4102
|
+
}
|
|
4103
|
+
return {
|
|
4104
|
+
type: "WhenClause",
|
|
4105
|
+
cases,
|
|
4106
|
+
expressions,
|
|
4107
|
+
children: $0
|
|
4108
|
+
};
|
|
4083
4109
|
});
|
|
4084
4110
|
var CaseClause$2 = $T($S(Default, ImpliedColon, $C(NestedBlockStatements, NoExpressions)), function(value) {
|
|
4085
4111
|
var exps = value[2];
|