@artel/artc 0.6.26028 → 0.6.26030

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/build/Cli.js CHANGED
@@ -1,11 +1,11 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  CommandLineCompiler
4
- } from "./chunk-G5UKABEH.js";
5
- import "./chunk-SYVSMJJH.js";
4
+ } from "./chunk-54PBDJ2W.js";
5
+ import "./chunk-HHCWDLSE.js";
6
6
  import {
7
7
  __async
8
- } from "./chunk-SPNTJ746.js";
8
+ } from "./chunk-VD3HHVCM.js";
9
9
 
10
10
  // source/Cli.ts
11
11
  function main() {
package/build/api/Api.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Compiler
3
- } from "../chunk-SYVSMJJH.js";
3
+ } from "../chunk-HHCWDLSE.js";
4
4
  import {
5
5
  AccessKind,
6
6
  AccessedFunction_entity,
@@ -310,7 +310,7 @@ import {
310
310
  withoutQuotes,
311
311
  withoutTemplateQuotes,
312
312
  yieldTask
313
- } from "../chunk-SPNTJ746.js";
313
+ } from "../chunk-VD3HHVCM.js";
314
314
  export {
315
315
  AccessKind,
316
316
  AccessedFunction_entity,
@@ -6,9 +6,9 @@ import {
6
6
  PhysicalFileSystem,
7
7
  PhysicalTypeScriptLibrariesProvider,
8
8
  PrintingDiagnosticAcceptor
9
- } from "../chunk-G5UKABEH.js";
10
- import "../chunk-SYVSMJJH.js";
11
- import "../chunk-SPNTJ746.js";
9
+ } from "../chunk-54PBDJ2W.js";
10
+ import "../chunk-HHCWDLSE.js";
11
+ import "../chunk-VD3HHVCM.js";
12
12
  export {
13
13
  CommandLineCompiler,
14
14
  FileSystemUri,
@@ -107,7 +107,7 @@ import {
107
107
  sortModifiers,
108
108
  traverseTreeAsync,
109
109
  yieldTask
110
- } from "../chunk-SPNTJ746.js";
110
+ } from "../chunk-VD3HHVCM.js";
111
111
 
112
112
  // source/services/common/Types.ts
113
113
  import * as ls from "vscode-languageserver";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Compiler
3
- } from "./chunk-SYVSMJJH.js";
3
+ } from "./chunk-HHCWDLSE.js";
4
4
  import {
5
5
  ArtelVersion,
6
6
  Cached,
@@ -16,7 +16,7 @@ import {
16
16
  __async,
17
17
  performanceMeasurementStageNames,
18
18
  performanceMeasurementStages
19
- } from "./chunk-SPNTJ746.js";
19
+ } from "./chunk-VD3HHVCM.js";
20
20
 
21
21
  // source/executor/FileSystemUri.ts
22
22
  import { platform } from "os";
@@ -9,7 +9,7 @@ import {
9
9
  WellKnownDeclarationsLoadError,
10
10
  __async,
11
11
  createTsInteropInputsForCompilation
12
- } from "./chunk-SPNTJ746.js";
12
+ } from "./chunk-VD3HHVCM.js";
13
13
 
14
14
  // source/executor/Compiler.ts
15
15
  var Compiler = class {
@@ -764,7 +764,7 @@ var UniqueWithComparatorQuery = class extends Query {
764
764
  };
765
765
 
766
766
  // source/common/Constants.ts
767
- var ArtelVersion = true ? "0.6.26028" : "";
767
+ var ArtelVersion = true ? "0.6.26030" : "";
768
768
  var ArtelSourceFileExtensions = [".\u0430\u0440\u0442", ".\u0430\u0440\u0442\u0435\u043B\u044C", ".art", ".artel", ".\u0430\u0440\u0442\u043C", ".\u0430\u0440\u0442\u0435\u043B\u044C\u043C", ".artm", ".artelm"];
769
769
  var ArtelSourceFileExtensionSet = new Set(ArtelSourceFileExtensions);
770
770
  var ArtelSourceAndConfigurationFileExtensionSet = new Set(ArtelSourceFileExtensionSet).add(".json");
@@ -26797,6 +26797,7 @@ var FunctionEntityDetails = class {
26797
26797
  this.isJavaScriptIteratorMethod = false;
26798
26798
  this.hasObjectParameter = false;
26799
26799
  this.isSetter = false;
26800
+ this.nameSource = void 0;
26800
26801
  }
26801
26802
  };
26802
26803
  var VariableEntityDetails = class {
@@ -26811,6 +26812,7 @@ var VariableEntityDetails = class {
26811
26812
  this.isStatic = false;
26812
26813
  this.isConst = false;
26813
26814
  this.isObjectParameter = false;
26815
+ this.nameSource = void 0;
26814
26816
  }
26815
26817
  };
26816
26818
  var TypeOrExtensionEntityDetails = class {
@@ -26825,6 +26827,7 @@ var TypeOrExtensionEntityDetails = class {
26825
26827
  */
26826
26828
  this.areOwnComputedNamesOfMembersResolved = false;
26827
26829
  this.implicitlyImplementedAbstractMembersByImplementingMember = /* @__PURE__ */ new Map();
26830
+ this.nameSource = void 0;
26828
26831
  }
26829
26832
  };
26830
26833
  var PackageEntityDetails = class {
@@ -28102,10 +28105,11 @@ var FunctionLiteral2 = class _FunctionLiteral {
28102
28105
  }
28103
28106
  };
28104
28107
  var JsFunctionLiteral = class _JsFunctionLiteral {
28105
- constructor(parameters, body, isAsync, returnType, sourceLocation) {
28108
+ constructor(parameters, body, isAsync, isGenerator, returnType, sourceLocation) {
28106
28109
  this.parameters = parameters;
28107
28110
  this.body = body;
28108
28111
  this.isAsync = isAsync;
28112
+ this.isGenerator = isGenerator;
28109
28113
  this.returnType = returnType;
28110
28114
  this.sourceLocation = sourceLocation;
28111
28115
  this.kind = 39 /* JsFunctionLiteral */;
@@ -28115,6 +28119,7 @@ var JsFunctionLiteral = class _JsFunctionLiteral {
28115
28119
  this.parameters.map((p) => p.clone()),
28116
28120
  this.body.clone(),
28117
28121
  this.isAsync,
28122
+ this.isGenerator,
28118
28123
  this.returnType,
28119
28124
  this.sourceLocation
28120
28125
  );
@@ -30564,8 +30569,8 @@ function functionAccessExpression(func, isCallee, sourceLocation) {
30564
30569
  function functionLiteral(parameters, body, isAsync, returnType, sourceLocation) {
30565
30570
  return new FunctionLiteral2(parameters, body, isAsync, returnType, sourceLocation);
30566
30571
  }
30567
- function jsFunctionLiteral(parameters, body, isAsync, returnType, sourceLocation) {
30568
- return new JsFunctionLiteral(parameters, body, isAsync, returnType, sourceLocation);
30572
+ function jsFunctionLiteral(parameters, body, isAsync, isGenerator, returnType, sourceLocation) {
30573
+ return new JsFunctionLiteral(parameters, body, isAsync, isGenerator, returnType, sourceLocation);
30569
30574
  }
30570
30575
  function nestedFunctionDeclarationStatement(entity, parameters, body, isAsync, isGenerator, sourceLocation) {
30571
30576
  const declaration = new NestedFunctionDeclaration2(entity, parameters, body, isAsync, isGenerator, sourceLocation);
@@ -31080,6 +31085,9 @@ var Transformer = class {
31080
31085
  get transformedDeclaration() {
31081
31086
  return this.transformedDeclaration_;
31082
31087
  }
31088
+ get transformedTypeDeclaration() {
31089
+ return this.transformedTypeDeclaration_;
31090
+ }
31083
31091
  transformChildren(node) {
31084
31092
  switch (node.kind) {
31085
31093
  case 0 /* AsExpression */:
@@ -31825,13 +31833,16 @@ var Transformer = class {
31825
31833
  }
31826
31834
  transformPackageTypeDeclarationChildren(declaration) {
31827
31835
  const saveTransformedDeclaration = this.transformedDeclaration_;
31836
+ const saveTransformedTypeDeclaration = this.transformedTypeDeclaration_;
31828
31837
  this.transformedDeclaration_ = declaration;
31838
+ this.transformedTypeDeclaration_ = declaration;
31829
31839
  declaration.decorators = declaration.decorators.map((d) => this.transformDecorator(d));
31830
31840
  declaration.members = this.transformArrayWithErrorBoundary(
31831
31841
  declaration.members,
31832
31842
  (m) => this.transformTypeMemberDeclaration(m)
31833
31843
  );
31834
31844
  this.transformedDeclaration_ = saveTransformedDeclaration;
31845
+ this.transformedTypeDeclaration_ = saveTransformedTypeDeclaration;
31835
31846
  }
31836
31847
  transformTypeMemberDeclaration(declaration) {
31837
31848
  let result;
@@ -32026,9 +32037,12 @@ var Transformer = class {
32026
32037
  }
32027
32038
  transformPackageVariantTypeDeclarationChildren(declaration) {
32028
32039
  const saveTransformedDeclaration = this.transformedDeclaration_;
32040
+ const saveTransformedTypeDeclaration = this.transformedTypeDeclaration_;
32029
32041
  this.transformedDeclaration_ = declaration;
32042
+ this.transformedTypeDeclaration_ = declaration;
32030
32043
  declaration.variants = declaration.variants.map((v) => this.transformVariantValueDeclaration(v));
32031
32044
  this.transformedDeclaration_ = saveTransformedDeclaration;
32045
+ this.transformedTypeDeclaration_ = saveTransformedTypeDeclaration;
32032
32046
  }
32033
32047
  transformVariantValueDeclaration(node) {
32034
32048
  let action;
@@ -33076,6 +33090,15 @@ var GeneralLoweringContext = class {
33076
33090
  createJsFunctionCallMethodAccess(object, isOptionalChaining) {
33077
33091
  return jsPropertyAccessExpression(object, isOptionalChaining, "call", this.ectx.standardTypes.func);
33078
33092
  }
33093
+ createBindMethodCall(object, isOptionalChaining, argument2) {
33094
+ const bindMethodAccess = jsPropertyAccessExpression(
33095
+ object,
33096
+ isOptionalChaining,
33097
+ "bind",
33098
+ this.ectx.standardTypes.func
33099
+ );
33100
+ return callExpression(bindMethodAccess, false, [argument2], false, this.ectx.standardTypes.object, false);
33101
+ }
33079
33102
  createKeyForComputedNameWithSymbolKey(symbolDeclaration) {
33080
33103
  return symbolDeclaration.ifTypeMemberThenContainingType !== void 0 ? staticFieldGetAccess(symbolDeclaration) : variableGetAccess(symbolDeclaration);
33081
33104
  }
@@ -35637,9 +35660,19 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
35637
35660
  this.objectParameterLowering.tryRemoveObjectParameterFromNestedFunction(node);
35638
35661
  return preserveNode();
35639
35662
  },
35663
+ transformNestedFunctionDeclarationStatement: (node) => {
35664
+ if (transformer.transformedTypeDeclaration !== void 0 && !node.declaration.entity.details.hasObjectParameter) {
35665
+ return replaceStatement(this.bindThisToNestedFunctionDeclaration(node));
35666
+ }
35667
+ return preserveStatement();
35668
+ },
35640
35669
  transformFunctionJsObjectLiteralProperty: (node) => {
35641
35670
  this.objectParameterLowering.tryRemoveObjectParameterFromFunctionJsObjectLiteralProperty(node);
35642
35671
  return preserveNode();
35672
+ },
35673
+ transformBlockStatement: (node) => {
35674
+ this.moveNestedFunctionsToTheBeginningOfTheBlock(node);
35675
+ return preserveStatement();
35643
35676
  }
35644
35677
  });
35645
35678
  transformer.transformPackage(this.pkg.ir);
@@ -35858,6 +35891,40 @@ var UsagesLowering = class _UsagesLowering extends ExecutableCodeLowering {
35858
35891
  const { expression, tempVariables } = this.replaceCompoundAssignmentWithSimpleAssignment(node);
35859
35892
  return replaceExpression(expression, tempVariables);
35860
35893
  }
35894
+ moveNestedFunctionsToTheBeginningOfTheBlock(node) {
35895
+ const statements = node.statements;
35896
+ if (!statements.some((s) => s.kind === 33 /* NestedFunctionDeclarationStatement */)) {
35897
+ return;
35898
+ }
35899
+ node.statements = [
35900
+ ...statements.filter((s) => s.kind === 33 /* NestedFunctionDeclarationStatement */),
35901
+ ...statements.filter((s) => s.kind !== 33 /* NestedFunctionDeclarationStatement */)
35902
+ ];
35903
+ }
35904
+ bindThisToNestedFunctionDeclaration(node) {
35905
+ const declaration = node.declaration;
35906
+ const jsFunctionLiteral2 = jsFunctionLiteral(
35907
+ declaration.parameters,
35908
+ declaration.body,
35909
+ declaration.isAsync,
35910
+ declaration.isGenerator,
35911
+ declaration.entity.returnType,
35912
+ declaration.sourceLocation
35913
+ );
35914
+ const bindCall = this.ctx.createBindMethodCall(
35915
+ jsFunctionLiteral2,
35916
+ false,
35917
+ thisExpression(this.ctx.ectx.standardTypes.object)
35918
+ );
35919
+ const localVariableEntity2 = localVariableEntity(
35920
+ declaration.entity.name,
35921
+ this.ctx.ectx.standardTypes.func,
35922
+ this.packageEntity,
35923
+ true
35924
+ );
35925
+ declaration.entity.details.nameSource = localVariableEntity2;
35926
+ return localVariableDeclarationStatement(localVariableEntity2, bindCall, node.sourceLocation);
35927
+ }
35861
35928
  };
35862
35929
  var OperatorsUsageLowering = class extends ExecutableCodeLowering {
35863
35930
  tryLowerPrefixUnaryExpression(node) {
@@ -36420,6 +36487,7 @@ var ObjectParameterLowering = class extends ExecutableCodeLowering {
36420
36487
  node.parameters.slice(1),
36421
36488
  node.body,
36422
36489
  node.isAsync,
36490
+ false,
36423
36491
  node.returnType,
36424
36492
  node.sourceLocation
36425
36493
  );
@@ -39284,7 +39352,8 @@ var _IrToJs = class _IrToJs {
39284
39352
  const parameters = this.convertParameters(expression.parameters);
39285
39353
  const body = this.convertBlockStatement(expression.body);
39286
39354
  const async = expression.isAsync;
39287
- const result = js.functionExpression(void 0, parameters, body, false, async);
39355
+ const generator = expression.isGenerator;
39356
+ const result = js.functionExpression(void 0, parameters, body, generator, async);
39288
39357
  this.addNodeLocation(result, expression);
39289
39358
  return result;
39290
39359
  }
@@ -39945,7 +40014,11 @@ var _IrToJs = class _IrToJs {
39945
40014
  }
39946
40015
  }
39947
40016
  getEntityName(entity) {
39948
- return this.entityNameOverrides?.get(entity) ?? entity.name;
40017
+ let namedEntity = entity;
40018
+ while (namedEntity.details.nameSource !== void 0) {
40019
+ namedEntity = namedEntity.details.nameSource;
40020
+ }
40021
+ return this.entityNameOverrides?.get(namedEntity) ?? namedEntity.name;
39949
40022
  }
39950
40023
  convertArrayWithErrorBoundary(array, convert) {
39951
40024
  const result = new Array();
@@ -38,6 +38,7 @@ export declare class FunctionEntityDetails implements TypeMemberEntityDetails {
38
38
  hasObjectParameter: boolean;
39
39
  variableOwningAccessor: VariableEntity | undefined;
40
40
  isSetter: boolean;
41
+ nameSource: NamedEntity | undefined;
41
42
  }
42
43
  export interface ComputedNameInfo {
43
44
  /**
@@ -76,6 +77,7 @@ export declare class VariableEntityDetails implements TypeMemberEntityDetails {
76
77
  isStatic: boolean;
77
78
  isConst: boolean;
78
79
  isObjectParameter: boolean;
80
+ nameSource: NamedEntity | undefined;
79
81
  }
80
82
  export interface ProxiedFieldInfo {
81
83
  readonly tagType: TypeOrExtensionEntity;
@@ -118,6 +120,7 @@ export declare class TypeOrExtensionEntityDetails {
118
120
  */
119
121
  areOwnComputedNamesOfMembersResolved: boolean;
120
122
  implicitlyImplementedAbstractMembersByImplementingMember: ReadonlyMap<TypeMemberEntity, readonly TypeMemberEntity[]>;
123
+ nameSource: NamedEntity | undefined;
121
124
  }
122
125
  export declare enum TypeOrExtensionEntityKind {
123
126
  StructuredType = 0,
@@ -73,7 +73,7 @@ export declare function loopStatement(label: string | undefined, body: ir.BlockS
73
73
  export declare function measureLiteral(sourceLocation?: ir.SourceLocation): ir.MeasureLiteral;
74
74
  export declare function functionAccessExpression(func: ir.AccessedFunction, isCallee: boolean, sourceLocation?: ir.SourceLocation): ir.FunctionAccessExpression;
75
75
  export declare function functionLiteral(parameters: readonly ir.ParameterDeclaration[], body: ir.BlockStatement, isAsync: boolean, returnType: Type, sourceLocation?: ir.SourceLocation): ir.FunctionLiteral;
76
- export declare function jsFunctionLiteral(parameters: readonly ir.ParameterDeclaration[], body: ir.BlockStatement, isAsync: boolean, returnType: Type, sourceLocation?: ir.SourceLocation): ir.JsFunctionLiteral;
76
+ export declare function jsFunctionLiteral(parameters: readonly ir.ParameterDeclaration[], body: ir.BlockStatement, isAsync: boolean, isGenerator: boolean, returnType: Type, sourceLocation?: ir.SourceLocation): ir.JsFunctionLiteral;
77
77
  export declare function nestedFunctionDeclaration(entity: FunctionEntity, parameters: readonly ir.ParameterDeclaration[], body: ir.BlockStatement, isAsync: boolean, isGenerator: boolean, sourceLocation?: ir.SourceLocation): ir.NestedFunctionDeclaration;
78
78
  export declare function nestedFunctionDeclarationStatement(entity: FunctionEntity, parameters: readonly ir.ParameterDeclaration[], body: ir.BlockStatement, isAsync: boolean, isGenerator: boolean, sourceLocation?: ir.SourceLocation): ir.NestedFunctionDeclarationStatement;
79
79
  export declare function nestedFunctionDeclarationStatementWithDeclaration(declaration: ir.NestedFunctionDeclaration, sourceLocation?: ir.SourceLocation): ir.NestedFunctionDeclarationStatement;
@@ -6,7 +6,9 @@ export declare class Transformer {
6
6
  protected readonly debugStack: DebugStack;
7
7
  private hoistedLocalVariables;
8
8
  private transformedDeclaration_;
9
+ private transformedTypeDeclaration_;
9
10
  get transformedDeclaration(): ir.Declaration | undefined;
11
+ get transformedTypeDeclaration(): ir.PackageTypeDeclaration | ir.PackageVariantTypeDeclaration | undefined;
10
12
  constructor(config: TransformationConfig);
11
13
  transformChildren(node: ir.Node): void;
12
14
  transformPackage(pkg: ir.Package): void;
@@ -551,10 +551,11 @@ export declare class JsFunctionLiteral {
551
551
  parameters: readonly ParameterDeclaration[];
552
552
  body: BlockStatement;
553
553
  isAsync: boolean;
554
+ isGenerator: boolean;
554
555
  returnType: Type;
555
556
  sourceLocation?: SourceLocation | undefined;
556
557
  readonly kind = NodeKind.JsFunctionLiteral;
557
- constructor(parameters: readonly ParameterDeclaration[], body: BlockStatement, isAsync: boolean, returnType: Type, sourceLocation?: SourceLocation | undefined);
558
+ constructor(parameters: readonly ParameterDeclaration[], body: BlockStatement, isAsync: boolean, isGenerator: boolean, returnType: Type, sourceLocation?: SourceLocation | undefined);
558
559
  clone(): JsFunctionLiteral;
559
560
  }
560
561
  export declare class Modifiers {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artel/artc",
3
- "version": "0.6.26028",
3
+ "version": "0.6.26030",
4
4
  "description": "Артель Компилятор | Artel Compiler",
5
5
  "author": "Nezaboodka Team <contact@nezaboodka.com>",
6
6
  "license": "Apache-2.0",
@@ -44,7 +44,7 @@
44
44
  "@babel/types": "7.27.3",
45
45
  "@vscode/l10n": "0.0.18",
46
46
  "jsonc-parser": "3.3.1",
47
- "reactronic": "^0.96.26024",
47
+ "reactronic": "^0.96.26025",
48
48
  "typescript": "5.9.3",
49
49
  "vscode-json-languageservice": "5.4.2",
50
50
  "vscode-languageserver": "9.0.1",