@danielx/civet 0.4.1-8.2 → 0.4.1-8.3
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/README.md +1 -0
- package/dist/civet +15 -9
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -216,6 +216,7 @@ of numbers with `1..toString()` use `1.toString()` instead. When exponent follow
|
|
|
216
216
|
could be a valid property `1.e10` -> `1..e10`. The workaround is to add a trailing zero `1.0e10` or remove the dot before the exponent `1e10`.
|
|
217
217
|
- Additional reserved words `and`, `or`, `loop`, `until`, `unless`
|
|
218
218
|
- No whitespace between unary operators and operands. Mandatory whitespace between condition and ternary `?` ex. `x ? a : b` since `x?` is the unary existential operator.
|
|
219
|
+
- No labels (yet...)
|
|
219
220
|
|
|
220
221
|
CoffeeScript Compatibility
|
|
221
222
|
---
|
package/dist/civet
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var compile, encoding, fs, generate, parse, prune,
|
|
3
|
+
var compile, encoding, fs, generate, parse, prune, readLines, readline;
|
|
4
4
|
if (process.argv.includes("--version")) {
|
|
5
5
|
process.stdout.write(require("../package.json").version + "\n");
|
|
6
6
|
process.exit(0);
|
|
@@ -8,22 +8,26 @@ if (process.argv.includes("--version")) {
|
|
|
8
8
|
({ parse, compile, generate } = require("./main"));
|
|
9
9
|
({ prune } = generate);
|
|
10
10
|
encoding = "utf8";
|
|
11
|
+
process.stdin.setEncoding(encoding);
|
|
11
12
|
fs = require("fs");
|
|
12
|
-
|
|
13
|
+
readline = require("node:readline");
|
|
14
|
+
readLines = function(rl) {
|
|
13
15
|
return new Promise(function(resolve, reject) {
|
|
14
16
|
var parts;
|
|
15
17
|
parts = [];
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return parts.push(buffer);
|
|
18
|
+
rl.on("line", function(buffer) {
|
|
19
|
+
return parts.push(buffer + "\n");
|
|
19
20
|
});
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
return
|
|
21
|
+
rl.on("SIGINT", function() {
|
|
22
|
+
rl.write("^C\n");
|
|
23
|
+
return reject();
|
|
24
|
+
});
|
|
25
|
+
return rl.on("close", function() {
|
|
26
|
+
return resolve(parts.join(""));
|
|
23
27
|
});
|
|
24
28
|
});
|
|
25
29
|
};
|
|
26
|
-
|
|
30
|
+
readLines(readline.createInterface(process.stdin, process.stdout)).then(function(input) {
|
|
27
31
|
var ast, inlineMap, js, output;
|
|
28
32
|
process.argv.includes("--ast");
|
|
29
33
|
js = process.argv.includes("--js");
|
|
@@ -35,4 +39,6 @@ read(process.stdin, encoding).then(function(input) {
|
|
|
35
39
|
}
|
|
36
40
|
output = compile(input, { js, inlineMap });
|
|
37
41
|
return process.stdout.write(output);
|
|
42
|
+
}).catch(function() {
|
|
43
|
+
return process.exit(1);
|
|
38
44
|
});
|