goldstein 5.0.0 → 5.0.2

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/ChangeLog CHANGED
@@ -1,3 +1,19 @@
1
+ 2024.02.19, v5.0.2
2
+
3
+ feature:
4
+ - 7b1e60e goldstein: supertape v10.1.0
5
+ - 448fd5b goldstein: @putout/test v9.0.1
6
+ - 9e4433d goldstein: esbuild v0.20.1
7
+ - 302b0c4 goldstein: @putout/plugin-declare v3.0.0
8
+
9
+ 2024.01.29, v5.0.1
10
+
11
+ feature:
12
+ - ea5ffdd goldstein: @putout/printer v8.0.1
13
+ - 74221ae ifStatement: VariableDeclaration: drop semicolons
14
+ - fa700a3 goldstein: c8 v9.1.0
15
+ - 28b77bb goldstein: putout v35.0.0
16
+
1
17
  2023.12.12, v5.0.0
2
18
 
3
19
  feature:
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Goldstein [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
1
+ # 🤫Goldstein [![License][LicenseIMGURL]][LicenseURL] [![NPM version][NPMIMGURL]][NPMURL] [![Build Status][BuildStatusIMGURL]][BuildStatusURL] [![Coverage Status][CoverageIMGURL]][CoverageURL]
2
2
 
3
3
  [NPMURL]: https://npmjs.org/package/goldstein "npm"
4
4
  [NPMIMGURL]: https://img.shields.io/npm/v/goldstein.svg?style=flat
package/build/parser.cjs CHANGED
@@ -2568,11 +2568,13 @@ pp$5.parseExprImport = function(forNew) {
2568
2568
  if (this.containsEsc) {
2569
2569
  this.raiseRecoverable(this.start, "Escape sequence in keyword import");
2570
2570
  }
2571
- var meta = this.parseIdent(true);
2571
+ this.next();
2572
2572
  if (this.type === types$1.parenL && !forNew) {
2573
2573
  return this.parseDynamicImport(node);
2574
2574
  } else if (this.type === types$1.dot) {
2575
- node.meta = meta;
2575
+ var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
2576
+ meta.name = "import";
2577
+ node.meta = this.finishNode(meta, "Identifier");
2576
2578
  return this.parseImportMeta(node);
2577
2579
  } else {
2578
2580
  this.unexpected();
@@ -2703,7 +2705,7 @@ pp$5.parseNew = function() {
2703
2705
  var node = this.startNode();
2704
2706
  this.next();
2705
2707
  if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
2706
- var meta = this.startNodeAt(node.start, node.startLoc);
2708
+ var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
2707
2709
  meta.name = "new";
2708
2710
  node.meta = this.finishNode(meta, "Identifier");
2709
2711
  this.next();
@@ -5355,7 +5357,7 @@ pp.readWord = function() {
5355
5357
  }
5356
5358
  return this.finishToken(type, word);
5357
5359
  };
5358
- var version = "8.11.2";
5360
+ var version = "8.11.3";
5359
5361
  Parser.acorn = {
5360
5362
  Parser,
5361
5363
  version,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "goldstein",
3
- "version": "5.0.0",
3
+ "version": "5.0.2",
4
4
  "type": "module",
5
5
  "author": "coderaiser <mnemonic.enemy@gmail.com> (https://github.com/coderaiser)",
6
6
  "description": "JavaScript with no limits",
@@ -29,22 +29,23 @@
29
29
  "wisdom": "madrun wisdom"
30
30
  },
31
31
  "dependencies": {
32
- "@putout/plugin-declare": "^2.0.1",
32
+ "@putout/plugin-declare": "^3.0.0",
33
33
  "@putout/plugin-logical-expressions": "^5.0.0",
34
34
  "@putout/plugin-try-catch": "^3.0.0",
35
- "@putout/printer": "^7.1.0",
35
+ "@putout/printer": "^8.0.1",
36
36
  "acorn": "^8.7.1",
37
- "esbuild": "^0.19.2",
37
+ "esbuild": "^0.20.1",
38
38
  "esbuild-node-builtins": "^0.1.0",
39
39
  "estree-to-babel": "^9.0.0",
40
- "putout": "^34.0.7",
40
+ "putout": "^35.0.0",
41
41
  "try-catch": "^3.0.1"
42
42
  },
43
43
  "license": "MIT",
44
44
  "devDependencies": {
45
+ "@babel/core": "^8.0.0-alpha.5",
45
46
  "@cloudcmd/stub": "^4.0.1",
46
- "@putout/test": "^8.0.0",
47
- "c8": "^8.0.0",
47
+ "@putout/test": "^9.0.1",
48
+ "c8": "^9.1.0",
48
49
  "check-dts": "^0.7.1",
49
50
  "escover": "^4.0.1",
50
51
  "eslint": "^8.48.0",
@@ -55,7 +56,7 @@
55
56
  "montag": "^1.2.1",
56
57
  "nodemon": "^3.0.1",
57
58
  "runsome": "^1.0.0",
58
- "supertape": "^9.0.0",
59
+ "supertape": "^10.1.0",
59
60
  "typescript": "^5.0.3"
60
61
  },
61
62
  "engines": {
@@ -9,7 +9,23 @@ export const IfStatement = (path, printer, semantics) => {
9
9
 
10
10
  indent();
11
11
  print('if ');
12
- print('__test');
12
+
13
+ const testPath = path.get('test');
14
+
15
+ if (testPath.isVariableDeclaration()) {
16
+ const first = testPath.get('declarations.0');
17
+ const id = first.get('id');
18
+ const init = first.get('init');
19
+
20
+ print(testPath.node.kind);
21
+ print(' ');
22
+ print(id);
23
+ print(' = ');
24
+ print(init);
25
+ } else {
26
+ print('__test');
27
+ }
28
+
13
29
  print(' ');
14
30
  print('__consequent');
15
31