@artel/artc 0.9.26036-pre-release → 0.9.26038-pre-release

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-D247ZQ57.js";
5
- import "./chunk-AUCAONLF.js";
4
+ } from "./chunk-NRZEWWTT.js";
5
+ import "./chunk-3I4SQIYG.js";
6
6
  import {
7
7
  __async
8
- } from "./chunk-JTOL3VLA.js";
8
+ } from "./chunk-62UH22KS.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-AUCAONLF.js";
3
+ } from "../chunk-3I4SQIYG.js";
4
4
  import {
5
5
  AccessKind,
6
6
  AccessedFunction_entity,
@@ -197,7 +197,7 @@ import {
197
197
  TagArgument_boolean,
198
198
  TagArgument_invalid,
199
199
  TagArgument_numeric,
200
- TagArgument_string,
200
+ TagArgument_text,
201
201
  TagArgument_variableExpression,
202
202
  TagFunction,
203
203
  TagType,
@@ -311,7 +311,7 @@ import {
311
311
  withoutQuotes,
312
312
  withoutTemplateQuotes,
313
313
  yieldTask
314
- } from "../chunk-JTOL3VLA.js";
314
+ } from "../chunk-62UH22KS.js";
315
315
  export {
316
316
  AccessKind,
317
317
  AccessedFunction_entity,
@@ -506,7 +506,7 @@ export {
506
506
  TagArgument_boolean,
507
507
  TagArgument_invalid,
508
508
  TagArgument_numeric,
509
- TagArgument_string,
509
+ TagArgument_text,
510
510
  TagArgument_variableExpression,
511
511
  TagFunction,
512
512
  TagType,
@@ -6,9 +6,9 @@ import {
6
6
  PhysicalFileSystem,
7
7
  PhysicalTypeScriptLibrariesProvider,
8
8
  PrintingDiagnosticAcceptor
9
- } from "../chunk-D247ZQ57.js";
10
- import "../chunk-AUCAONLF.js";
11
- import "../chunk-JTOL3VLA.js";
9
+ } from "../chunk-NRZEWWTT.js";
10
+ import "../chunk-3I4SQIYG.js";
11
+ import "../chunk-62UH22KS.js";
12
12
  export {
13
13
  CommandLineCompiler,
14
14
  FileSystemUri,
@@ -102,6 +102,7 @@ import {
102
102
  isIdentifier2,
103
103
  isKeyword,
104
104
  isKeyword2,
105
+ isNamedFunctionEntity,
105
106
  isNamedTypeEntity,
106
107
  isNarrowableReferenceExpression,
107
108
  isNarrowableReferenceExpression2,
@@ -140,7 +141,7 @@ import {
140
141
  traverseTreeAsync,
141
142
  traverseTreeAsync2,
142
143
  yieldTask
143
- } from "../chunk-JTOL3VLA.js";
144
+ } from "../chunk-62UH22KS.js";
144
145
 
145
146
  // source/services/common/Types.ts
146
147
  import * as ls from "vscode-languageserver";
@@ -9870,7 +9871,89 @@ var EntityToSyntax = class {
9870
9871
  return SyntaxFactory.modifier(41 /* Hidden */, levelKeyword);
9871
9872
  }
9872
9873
  convertTags(entityTags) {
9873
- return [];
9874
+ return entityTags.map((t) => this.convertTag(t)).filter((t) => t !== void 0);
9875
+ }
9876
+ convertTag(tag) {
9877
+ let name;
9878
+ let typeArguments;
9879
+ let parameterEntities;
9880
+ switch (tag.kind) {
9881
+ case "function": {
9882
+ const func = tag.func;
9883
+ if (!isNamedFunctionEntity(func.entity)) {
9884
+ return void 0;
9885
+ }
9886
+ name = this.getEntityName(func.entity);
9887
+ typeArguments = func.kind === "substituted-function" ? Query.from(func.value.getSubstitutions().getTypes()).map((t) => this.convertType(t)).toArray() : void 0;
9888
+ parameterEntities = func.entity.getParameters();
9889
+ break;
9890
+ }
9891
+ case "type": {
9892
+ const typeEntity = tag.typeEntity;
9893
+ if (!isNamedTypeEntity(typeEntity)) {
9894
+ return void 0;
9895
+ }
9896
+ name = this.getEntityName(typeEntity);
9897
+ const substitutions = tag.constructor_.substitutions;
9898
+ typeArguments = substitutions.size > 0 ? Query.from(substitutions.getTypes()).map((t) => this.convertType(t)).toArray() : void 0;
9899
+ parameterEntities = tag.constructor_.entity.getParameters();
9900
+ break;
9901
+ }
9902
+ default:
9903
+ Debug.never(tag);
9904
+ }
9905
+ let args;
9906
+ if (tag.argumentByOriginalParameter.size > 0) {
9907
+ args = [];
9908
+ for (const parameterEntity of parameterEntities) {
9909
+ const argument = tag.argumentByOriginalParameter.get(parameterEntity.originalEntity);
9910
+ if (argument !== void 0) {
9911
+ let argumentExpression;
9912
+ switch (argument.kind) {
9913
+ case "text":
9914
+ argumentExpression = SyntaxFactory.textLiteral(argument.value);
9915
+ break;
9916
+ case "boolean":
9917
+ argumentExpression = SyntaxFactory.booleanLiteral(argument.value);
9918
+ break;
9919
+ case "numeric":
9920
+ argumentExpression = SyntaxFactory.numericLiteral(argument.value);
9921
+ break;
9922
+ case "variable-expression": {
9923
+ const firstSegmentEntity = argument.segments[0];
9924
+ if (firstSegmentEntity.subkind === "field") {
9925
+ const containingType = firstSegmentEntity.getContainingType();
9926
+ if (!isNamedTypeEntity(containingType)) {
9927
+ return void 0;
9928
+ }
9929
+ argumentExpression = SyntaxFactory.memberAccessExpression(
9930
+ SyntaxFactory.identifierExpression(this.getEntityName(containingType)),
9931
+ this.getEntityName(firstSegmentEntity)
9932
+ );
9933
+ } else {
9934
+ argumentExpression = SyntaxFactory.identifierExpression(this.getEntityName(firstSegmentEntity));
9935
+ }
9936
+ for (let i = 1; i < argument.segments.length; i++) {
9937
+ argumentExpression = SyntaxFactory.memberAccessExpression(
9938
+ argumentExpression,
9939
+ this.getEntityName(argument.segments[i])
9940
+ );
9941
+ }
9942
+ break;
9943
+ }
9944
+ case "invalid":
9945
+ argumentExpression = SyntaxFactory.missingExpression();
9946
+ break;
9947
+ default:
9948
+ Debug.never(argument);
9949
+ }
9950
+ args.push(SyntaxFactory.argument(argumentExpression));
9951
+ } else {
9952
+ args.push(SyntaxFactory.argument(SyntaxFactory.missingExpression()));
9953
+ }
9954
+ }
9955
+ }
9956
+ return SyntaxFactory.tag(name, typeArguments, args);
9874
9957
  }
9875
9958
  getEntityName(entity) {
9876
9959
  return entity.getName().unescapedOriginal;
@@ -10103,12 +10186,14 @@ var EntityToSyntax2 = class {
10103
10186
  const getterEntity = entity.getGetter();
10104
10187
  if (getterEntity !== void 0) {
10105
10188
  const parameters = this.convertParameters(getterEntity.getParameters());
10106
- result.push(SyntaxFactory2.packageVariableGetterDeclaration(tags, name, parameters, type, void 0));
10189
+ const body = SyntaxFactory2.emptyFunctionBlock();
10190
+ result.push(SyntaxFactory2.packageVariableGetterDeclaration(tags, name, parameters, type, body));
10107
10191
  }
10108
10192
  const setterEntity = entity.getSetter();
10109
10193
  if (setterEntity !== void 0) {
10110
10194
  const parameters = this.convertParameters(setterEntity.getParameters());
10111
- result.push(SyntaxFactory2.packageVariableSetterDeclaration(tags, name, parameters, void 0));
10195
+ const body = SyntaxFactory2.emptyFunctionBlock();
10196
+ result.push(SyntaxFactory2.packageVariableSetterDeclaration(tags, name, parameters, body));
10112
10197
  }
10113
10198
  } else {
10114
10199
  result = SyntaxFactory2.packageVariableDeclaration(tags, name, type, void 0);
@@ -10121,14 +10206,8 @@ var EntityToSyntax2 = class {
10121
10206
  const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
10122
10207
  const parameters = this.convertParameters(entity.getParameters());
10123
10208
  const returnType = this.convertTypeIfNotNullType(entity.getReturnType());
10124
- return SyntaxFactory2.packageFunctionDeclaration(
10125
- tags,
10126
- name,
10127
- typeParameters,
10128
- parameters,
10129
- returnType,
10130
- void 0
10131
- );
10209
+ const body = SyntaxFactory2.emptyFunctionBlock();
10210
+ return SyntaxFactory2.packageFunctionDeclaration(tags, name, typeParameters, parameters, returnType, body);
10132
10211
  }
10133
10212
  convertPackageType(entity) {
10134
10213
  switch (entity.typeEntityKind) {
@@ -10250,7 +10329,8 @@ var EntityToSyntax2 = class {
10250
10329
  const typeParameters = this.convertTypeParameters(entity.getTypeParameters());
10251
10330
  const parameters = this.convertParameters(entity.getParameters());
10252
10331
  const returnType = this.convertTypeIfNotNullType(entity.getReturnType());
10253
- return SyntaxFactory2.methodDeclaration(tags, name, typeParameters, parameters, returnType, void 0);
10332
+ const body = SyntaxFactory2.emptyFunctionBlock();
10333
+ return SyntaxFactory2.methodDeclaration(tags, name, typeParameters, parameters, returnType, body);
10254
10334
  }
10255
10335
  case 5 /* Accessor */:
10256
10336
  return this.convertTypeMemberAccessor(entity);
@@ -10297,7 +10377,8 @@ var EntityToSyntax2 = class {
10297
10377
  const name = this.getEntityName(owningEntity);
10298
10378
  const type = this.convertType(entity.getReturnType());
10299
10379
  const parameters = this.convertParameters(entity.getParameters());
10300
- return SyntaxFactory2.fieldGetterDeclaration(tags, name, parameters, type, void 0);
10380
+ const body = SyntaxFactory2.emptyFunctionBlock();
10381
+ return SyntaxFactory2.fieldGetterDeclaration(tags, name, parameters, type, body);
10301
10382
  }
10302
10383
  case 3 /* FieldSetter */: {
10303
10384
  const owningEntity = entity.getAccessorOwner();
@@ -10306,12 +10387,14 @@ var EntityToSyntax2 = class {
10306
10387
  }
10307
10388
  const name = this.getEntityName(owningEntity);
10308
10389
  const parameters = this.convertParameters(entity.getParameters());
10309
- return SyntaxFactory2.fieldSetterDeclaration(tags, name, parameters, void 0);
10390
+ const body = SyntaxFactory2.emptyFunctionBlock();
10391
+ return SyntaxFactory2.fieldSetterDeclaration(tags, name, parameters, body);
10310
10392
  }
10311
10393
  case 4 /* IndexedElementGetter */: {
10312
10394
  const parameters = this.convertParameters(entity.getParameters());
10313
10395
  const type = this.convertType(entity.getReturnType());
10314
- return SyntaxFactory2.indexedElementGetterDeclaration(tags, parameters, type, void 0);
10396
+ const body = SyntaxFactory2.emptyFunctionBlock();
10397
+ return SyntaxFactory2.indexedElementGetterDeclaration(tags, parameters, type, body);
10315
10398
  }
10316
10399
  case 5 /* IndexedElementSetter */: {
10317
10400
  const owningEntity = entity.getAccessorOwner();
@@ -10320,7 +10403,8 @@ var EntityToSyntax2 = class {
10320
10403
  }
10321
10404
  const parameterEntities = entity.getParameters();
10322
10405
  const parameters = this.convertParameters(parameterEntities);
10323
- return SyntaxFactory2.indexedElementSetterDeclaration(tags, parameters, void 0);
10406
+ const body = SyntaxFactory2.emptyFunctionBlock();
10407
+ return SyntaxFactory2.indexedElementSetterDeclaration(tags, parameters, body);
10324
10408
  }
10325
10409
  case 6 /* DereferencedVariableGetter */:
10326
10410
  case 7 /* DereferencedVariableSetter */:
@@ -10436,11 +10520,96 @@ var EntityToSyntax2 = class {
10436
10520
  break;
10437
10521
  }
10438
10522
  }
10439
- return Array.from(wkTagFlags).map((it) => {
10523
+ const result = Array.from(wkTagFlags).map((it) => {
10440
10524
  const name = getWellKnownTagFlagName(it, entity.locale);
10441
10525
  Debug.assert(name !== void 0);
10442
10526
  return SyntaxFactory2.tag(name.unescapedOriginal);
10443
10527
  });
10528
+ const entityTags = entity.getTags();
10529
+ result.push(...entityTags.filter((t) => !(t.kind === "type" && isPackageTypeEntity(t.typeEntity) && this.analyzer.tags.getWellKnownTagFlagByTagEntity(t.typeEntity) !== void 0)).map((t) => this.convertUserTag(t)).filter((t) => t !== void 0));
10530
+ return result;
10531
+ }
10532
+ convertUserTag(tag) {
10533
+ let name;
10534
+ let typeArguments;
10535
+ let parameterEntities;
10536
+ switch (tag.kind) {
10537
+ case "function": {
10538
+ const func = tag.func;
10539
+ if (!isNamedFunctionEntity(func.entity)) {
10540
+ return void 0;
10541
+ }
10542
+ name = this.getEntityName(func.entity);
10543
+ typeArguments = func.kind === "substituted-function" ? Query.from(func.value.getSubstitutions().getTypes()).map((t) => this.convertType(t)).toArray() : void 0;
10544
+ parameterEntities = func.entity.getParameters();
10545
+ break;
10546
+ }
10547
+ case "type": {
10548
+ const typeEntity = tag.typeEntity;
10549
+ if (!isNamedTypeEntity(typeEntity)) {
10550
+ return void 0;
10551
+ }
10552
+ name = this.getEntityName(typeEntity);
10553
+ const substitutions = tag.constructor_.substitutions;
10554
+ typeArguments = substitutions.size > 0 ? Query.from(substitutions.getTypes()).map((t) => this.convertType(t)).toArray() : void 0;
10555
+ parameterEntities = tag.constructor_.entity.getParameters();
10556
+ break;
10557
+ }
10558
+ default:
10559
+ Debug.never(tag);
10560
+ }
10561
+ let args;
10562
+ if (tag.argumentByOriginalParameter.size > 0) {
10563
+ args = [];
10564
+ for (const parameterEntity of parameterEntities) {
10565
+ const argument = tag.argumentByOriginalParameter.get(parameterEntity.originalEntity);
10566
+ if (argument !== void 0) {
10567
+ let argumentExpression;
10568
+ switch (argument.kind) {
10569
+ case "text":
10570
+ argumentExpression = SyntaxFactory2.textLiteral(argument.value);
10571
+ break;
10572
+ case "boolean":
10573
+ argumentExpression = SyntaxFactory2.booleanLiteral(argument.value);
10574
+ break;
10575
+ case "numeric":
10576
+ argumentExpression = SyntaxFactory2.numericLiteral(argument.value);
10577
+ break;
10578
+ case "variable-expression": {
10579
+ const firstSegmentEntity = argument.segments[0];
10580
+ if (firstSegmentEntity.subkind === "field") {
10581
+ const containingType = firstSegmentEntity.getContainingType();
10582
+ if (!isNamedTypeEntity(containingType)) {
10583
+ return void 0;
10584
+ }
10585
+ argumentExpression = SyntaxFactory2.memberAccessExpression(
10586
+ SyntaxFactory2.identifierExpression(this.getEntityName(containingType)),
10587
+ this.getEntityName(firstSegmentEntity)
10588
+ );
10589
+ } else {
10590
+ argumentExpression = SyntaxFactory2.identifierExpression(this.getEntityName(firstSegmentEntity));
10591
+ }
10592
+ for (let i = 1; i < argument.segments.length; i++) {
10593
+ argumentExpression = SyntaxFactory2.memberAccessExpression(
10594
+ argumentExpression,
10595
+ this.getEntityName(argument.segments[i])
10596
+ );
10597
+ }
10598
+ break;
10599
+ }
10600
+ case "invalid":
10601
+ argumentExpression = SyntaxFactory2.missingExpression();
10602
+ break;
10603
+ default:
10604
+ Debug.never(argument);
10605
+ }
10606
+ args.push(SyntaxFactory2.argument(argumentExpression));
10607
+ } else {
10608
+ args.push(SyntaxFactory2.argument(SyntaxFactory2.missingExpression()));
10609
+ }
10610
+ }
10611
+ }
10612
+ return SyntaxFactory2.tag(name, typeArguments, args);
10444
10613
  }
10445
10614
  getEntityName(entity) {
10446
10615
  return entity.getName().unescapedOriginal;
@@ -10787,6 +10956,18 @@ var CompilationController = class extends RxObject2 {
10787
10956
  reloadMainCompilation() {
10788
10957
  return __async(this, null, function* () {
10789
10958
  subscribeToFileSystemRecursively(this.rootDirectory);
10959
+ if (this.config.standardPackagesUri !== void 0 && this.config.standardPackagesUri.checkIfRelativeTo(this.rootDirectory.uri) === 2 /* NotRelativeOrEqual */) {
10960
+ const standardPackagesDirectory = this.fileSystemTree.getDirectory(this.config.standardPackagesUri);
10961
+ if (standardPackagesDirectory !== void 0) {
10962
+ subscribeToFileSystemRecursively(standardPackagesDirectory);
10963
+ }
10964
+ }
10965
+ if (this.config.builtInStandardPackagesUri !== void 0 && this.config.builtInStandardPackagesUri.checkIfRelativeTo(this.rootDirectory.uri) === 2 /* NotRelativeOrEqual */) {
10966
+ const standardPackagesDirectory = this.fileSystemTree.getDirectory(this.config.builtInStandardPackagesUri);
10967
+ if (standardPackagesDirectory !== void 0) {
10968
+ subscribeToFileSystemRecursively(standardPackagesDirectory);
10969
+ }
10970
+ }
10790
10971
  const configurationByPackageOrGroupUri = /* @__PURE__ */ new Map();
10791
10972
  for (const [packageUri, controller] of this.configurationControllerByPackageUri_) {
10792
10973
  if (!controller.hasConvertedConfiguration) {
@@ -12865,7 +13046,7 @@ var SourceGenerationService = class extends RxObject7 {
12865
13046
  break;
12866
13047
  }
12867
13048
  case 1 /* ArtelM */: {
12868
- const node = new EntityToSyntax2(analyzer, packageEntity).convert();
13049
+ const node = new EntityToSyntax2(analyzer.dialectM, packageEntity).convert();
12869
13050
  code = new SyntaxToCode2(node, { keywordsLocale: packageLocale }).convert();
12870
13051
  break;
12871
13052
  }
@@ -10,7 +10,7 @@ import {
10
10
  WellKnownDeclarationsLoadError,
11
11
  __async,
12
12
  createTsInteropInputsForCompilation
13
- } from "./chunk-JTOL3VLA.js";
13
+ } from "./chunk-62UH22KS.js";
14
14
 
15
15
  // source/executor/Compiler.ts
16
16
  var Compiler = class {
@@ -780,7 +780,7 @@ var UniqueWithComparatorQuery = class extends Query {
780
780
  };
781
781
 
782
782
  // source/common/Constants.ts
783
- var ArtelVersion = true ? "0.9.26036-pre-release" : "";
783
+ var ArtelVersion = true ? "0.9.26038-pre-release" : "";
784
784
  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"];
785
785
  var ArtelSourceFileExtensionSet = new Set(ArtelSourceFileExtensions);
786
786
  var ArtelSourceAndConfigurationFileExtensionSet = new Set(ArtelSourceFileExtensionSet).add(".json");
@@ -11211,6 +11211,44 @@ var SyntaxFactory = class {
11211
11211
  Debug.never(node);
11212
11212
  }
11213
11213
  }
11214
+ static argument(value, name) {
11215
+ let equalsToken;
11216
+ let nameIdentifier;
11217
+ if (name !== void 0) {
11218
+ equalsToken = this.token(64 /* Equals */);
11219
+ nameIdentifier = this.identifier(name);
11220
+ }
11221
+ return new Argument(nameIdentifier, equalsToken, value, void 0);
11222
+ }
11223
+ static missingExpression() {
11224
+ return new MissingExpression(void 0);
11225
+ }
11226
+ static booleanLiteral(value) {
11227
+ const keyword = value ? this.keyword(57 /* Yes */) : this.keyword(58 /* No */);
11228
+ return new KeywordExpression(keyword, void 0);
11229
+ }
11230
+ static textLiteral(valueWithoutQuotes) {
11231
+ const token = this.token(5 /* TextLiteral */, `"${valueWithoutQuotes}"`);
11232
+ return new TextLiteral(token, void 0);
11233
+ }
11234
+ static numericLiteral(value) {
11235
+ let token;
11236
+ if (Number.isInteger(value)) {
11237
+ token = this.token(2 /* IntegerLiteral */, value.toString());
11238
+ } else {
11239
+ token = this.token(3 /* RealLiteral */, value.toString());
11240
+ }
11241
+ return new TokenExpression(token, void 0);
11242
+ }
11243
+ static identifierExpression(value) {
11244
+ const valueIdentifier = this.identifier(value);
11245
+ return new IdentifierExpression(valueIdentifier, void 0);
11246
+ }
11247
+ static memberAccessExpression(expression, memberName) {
11248
+ const dotToken = this.token(34 /* Dot */);
11249
+ const memberNameIdentifier = this.identifier(memberName);
11250
+ return new MemberAccessExpression(expression, dotToken, memberNameIdentifier, void 0);
11251
+ }
11214
11252
  static identifier(value, flags = 0 /* None */) {
11215
11253
  if (typeof value === "string") {
11216
11254
  return this.createToken(9 /* Identifier */, value, flags);
@@ -17682,6 +17720,10 @@ var SyntaxFactory2 = class {
17682
17720
  void 0
17683
17721
  );
17684
17722
  }
17723
+ static emptyFunctionBlock() {
17724
+ const endKeyword = this.keyword(1011 /* End */);
17725
+ return new FunctionBlock2(void 0, new StatementList2([], void 0), void 0, endKeyword, void 0);
17726
+ }
17685
17727
  static localStructuredTypeDeclaration(name, baseTypes, members) {
17686
17728
  const typeKeyword = this.keyword(1033 /* Type */);
17687
17729
  const nameIdentifier = this.identifier(name);
@@ -17771,14 +17813,13 @@ var SyntaxFactory2 = class {
17771
17813
  return new ParameterDeclaration2(tagList, nameIdentifier, typeAnnotation, initializer, void 0);
17772
17814
  }
17773
17815
  static typeMemberDeclarationBlock(members) {
17774
- const openBraceToken = this.token(1046 /* OpenBrace */);
17775
17816
  const memberList = members instanceof Array ? new TypeMemberDeclarationList2(members, void 0) : members;
17776
- const closeBraceToken = this.token(1020 /* CloseBrace */);
17817
+ const endKeyword = this.keyword(1011 /* End */);
17777
17818
  return new TypeMemberDeclarationBlock2(
17778
- openBraceToken,
17819
+ void 0,
17779
17820
  memberList,
17780
- closeBraceToken,
17781
17821
  void 0,
17822
+ endKeyword,
17782
17823
  void 0
17783
17824
  );
17784
17825
  }
@@ -18116,6 +18157,44 @@ var SyntaxFactory2 = class {
18116
18157
  }
18117
18158
  return this.translationTypeParameterClause(typeParameters);
18118
18159
  }
18160
+ static argument(value, name) {
18161
+ let equalsToken;
18162
+ let nameIdentifier;
18163
+ if (name !== void 0) {
18164
+ equalsToken = this.token(1030 /* Equals */);
18165
+ nameIdentifier = this.identifier(name);
18166
+ }
18167
+ return new Argument2(nameIdentifier, equalsToken, value, void 0);
18168
+ }
18169
+ static missingExpression() {
18170
+ return new MissingExpression2(void 0);
18171
+ }
18172
+ static booleanLiteral(value) {
18173
+ const keyword = value ? this.keyword(1036 /* Yes */) : this.keyword(1022 /* No */);
18174
+ return new KeywordExpression2(keyword, void 0);
18175
+ }
18176
+ static textLiteral(valueWithoutQuotes) {
18177
+ const token = this.token(1062 /* TextLiteral */, `"${valueWithoutQuotes}"`);
18178
+ return new TextLiteral2(token, void 0);
18179
+ }
18180
+ static numericLiteral(value) {
18181
+ let token;
18182
+ if (Number.isInteger(value)) {
18183
+ token = this.token(1038 /* IntegerLiteral */, value.toString());
18184
+ } else {
18185
+ token = this.token(1057 /* RealLiteral */, value.toString());
18186
+ }
18187
+ return new TokenExpression2(token, void 0);
18188
+ }
18189
+ static identifierExpression(value) {
18190
+ const valueIdentifier = this.identifier(value);
18191
+ return new IdentifierExpression2(valueIdentifier, void 0);
18192
+ }
18193
+ static memberAccessExpression(expression, memberName) {
18194
+ const dotToken = this.token(1026 /* Dot */);
18195
+ const memberNameIdentifier = this.identifier(memberName);
18196
+ return new MemberAccessExpression2(expression, dotToken, memberNameIdentifier, void 0);
18197
+ }
18119
18198
  static identifier(value, flags = 0 /* None */) {
18120
18199
  if (typeof value === "string") {
18121
18200
  return this.createToken(1037 /* Identifier */, value, flags);
@@ -19185,8 +19264,8 @@ var SyntaxToCode2 = class _SyntaxToCode {
19185
19264
  if (node.openBraceToken !== void 0) {
19186
19265
  Debug.assert(node.endKeyword === void 0);
19187
19266
  this.writeToken(node.openBraceToken);
19267
+ this.writeNewLineOrWhitespace();
19188
19268
  }
19189
- this.writeNewLineOrWhitespace();
19190
19269
  if (node.memberList.elements.length > 0) {
19191
19270
  this.increaseIndentation();
19192
19271
  const addSemicolonsIfMissing = this.isSingleLineMode;
@@ -19520,7 +19599,16 @@ var SyntaxToCode2 = class _SyntaxToCode {
19520
19599
  if (addLeadingNewLineOrWhitespace) {
19521
19600
  this.writeNewLineOrWhitespace();
19522
19601
  }
19523
- this.writeNodeDefault(node);
19602
+ if (node.openBraceToken !== void 0) {
19603
+ this.writeToken(node.openBraceToken);
19604
+ this.writeNewLineOrWhitespace();
19605
+ }
19606
+ this.writeNodeDefault(node.statementList);
19607
+ if (node.closeBraceToken !== void 0) {
19608
+ this.writeToken(node.closeBraceToken);
19609
+ } else if (node.endKeyword !== void 0) {
19610
+ this.writeKeyword(node.endKeyword);
19611
+ }
19524
19612
  }
19525
19613
  writeVariableInitializer(node) {
19526
19614
  this.writeWhitespace();
@@ -33535,10 +33623,10 @@ var TagFunction = class extends TagBase {
33535
33623
  return this.func.entity;
33536
33624
  }
33537
33625
  };
33538
- var TagArgument_string = class {
33626
+ var TagArgument_text = class {
33539
33627
  constructor(value) {
33540
33628
  this.value = value;
33541
- this.kind = "string";
33629
+ this.kind = "text";
33542
33630
  }
33543
33631
  };
33544
33632
  var TagArgument_numeric = class {
@@ -43334,7 +43422,7 @@ var EntityMap = class _EntityMap {
43334
43422
  const realNameTag = findTag(this.analyzer.originalWellKnownDeclarationsA.realName, tags);
43335
43423
  if (realNameTag !== void 0) {
43336
43424
  const nameArgument = realNameTag.argumentByNameKey.get("\u0438\u043C\u044F");
43337
- if (nameArgument?.kind === "string") {
43425
+ if (nameArgument?.kind === "text") {
43338
43426
  result = nameArgument.value;
43339
43427
  }
43340
43428
  }
@@ -106375,7 +106463,7 @@ var Tags = class {
106375
106463
  const value = argument2.value;
106376
106464
  switch (value.kind) {
106377
106465
  case 1108 /* TextLiteral */:
106378
- result = new TagArgument_string(unescapeText(withoutQuotes(value.text.value)));
106466
+ result = new TagArgument_text(unescapeText(withoutQuotes(value.text.value)));
106379
106467
  break;
106380
106468
  case 1114 /* TokenExpression */:
106381
106469
  switch (value.token.tokenKind) {
@@ -117426,7 +117514,7 @@ var Tags2 = class {
117426
117514
  const value = argument2.value;
117427
117515
  switch (value.kind) {
117428
117516
  case 78 /* TextLiteral */:
117429
- result = new TagArgument_string(unescapeText(withoutQuotes(value.text.value)));
117517
+ result = new TagArgument_text(unescapeText(withoutQuotes(value.text.value)));
117430
117518
  break;
117431
117519
  case 77 /* TokenExpression */:
117432
117520
  switch (value.token.tokenKind) {
@@ -117955,7 +118043,7 @@ export {
117955
118043
  entityToStringDecorator,
117956
118044
  TagType,
117957
118045
  TagFunction,
117958
- TagArgument_string,
118046
+ TagArgument_text,
117959
118047
  TagArgument_numeric,
117960
118048
  TagArgument_boolean,
117961
118049
  TagArgument_variableExpression,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  Compiler
3
- } from "./chunk-AUCAONLF.js";
3
+ } from "./chunk-3I4SQIYG.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-JTOL3VLA.js";
19
+ } from "./chunk-62UH22KS.js";
20
20
 
21
21
  // source/executor/FileSystemUri.ts
22
22
  import { platform } from "os";
@@ -385,7 +385,7 @@ declare class Tags {
385
385
  private createTagFromNode;
386
386
  private argumentToTagArgument;
387
387
  getWellKnownTagFlagsOfNodeWithTags(node: tree.NodeWithTags): tree.WellKnownTagFlags;
388
- getWellKnownTagFlagByTagEntity(entity: e.PackageStructuredTypeEntity): tree.WellKnownTagFlags | undefined;
388
+ getWellKnownTagFlagByTagEntity(entity: e.PackageTypeEntity): tree.WellKnownTagFlags | undefined;
389
389
  getTagEntityByWellKnownTagFlag(flag: tree.WellKnownTagFlags, locale: PackageLocale): e.PackageTypeEntity | undefined;
390
390
  private getFlagByOriginalEntityMap;
391
391
  private getLocalizedEntityByFlagMap;
@@ -25,10 +25,10 @@ export declare class TagFunction extends TagBase {
25
25
  get entity(): TypeEntity | FunctionEntity;
26
26
  constructor(func: AccessedFunction, argumentByParameter: ReadonlyMap<ParameterEntity, TagArgument>);
27
27
  }
28
- export type TagArgument = TagArgument_string | TagArgument_numeric | TagArgument_boolean | TagArgument_variableExpression | TagArgument_invalid;
29
- export declare class TagArgument_string {
28
+ export type TagArgument = TagArgument_text | TagArgument_numeric | TagArgument_boolean | TagArgument_variableExpression | TagArgument_invalid;
29
+ export declare class TagArgument_text {
30
30
  readonly value: string;
31
- readonly kind = "string";
31
+ readonly kind = "text";
32
32
  constructor(value: string);
33
33
  }
34
34
  export declare class TagArgument_numeric {
@@ -41,6 +41,7 @@ export declare class EntityToSyntax {
41
41
  private convertParameter;
42
42
  private createHidingModifier;
43
43
  private convertTags;
44
+ private convertTag;
44
45
  private getEntityName;
45
46
  private groupTypeMemberDeclarations;
46
47
  private groupTypeMemberDeclarationsRecursively;
@@ -1,4 +1,4 @@
1
- import { Analyzer } from '../../../analysis/Analyzer.js';
1
+ import { Analyzer } from '../../../analysis/m/Analyzer.js';
2
2
  import { PackageEntity } from '../../../entities/index.js';
3
3
  import * as tree from '../../../tree/m/index.js';
4
4
  export declare class EntityToSyntax {
@@ -27,6 +27,7 @@ export declare class EntityToSyntax {
27
27
  private convertParameters;
28
28
  private convertParameter;
29
29
  private convertTags;
30
+ private convertUserTag;
30
31
  private getEntityName;
31
32
  private convertType;
32
33
  private convertStructuredType;
@@ -65,6 +65,13 @@ export declare class SyntaxFactory {
65
65
  static translationParameterClause(parameters: readonly (tree.Identifier | string)[]): tree.TranslationParameterClause;
66
66
  static indexParameterTranslationClause(parameters: readonly (tree.Identifier | string)[]): tree.IndexParameterTranslationClause;
67
67
  static typeMemberDeclarationWithModifiers(node: tree.TypeMemberDeclaration, modifiers: readonly tree.Modifier[] | tree.ModifierList): tree.TypeMemberDeclaration;
68
+ static argument(value: tree.Expression, name?: tree.Identifier | string): tree.Argument;
69
+ static missingExpression(): tree.MissingExpression;
70
+ static booleanLiteral(value: boolean): tree.KeywordExpression;
71
+ static textLiteral(valueWithoutQuotes: string): tree.TextLiteral;
72
+ static numericLiteral(value: number): tree.TokenExpression;
73
+ static identifierExpression(value: tree.Identifier | string): tree.IdentifierExpression;
74
+ static memberAccessExpression(expression: tree.Expression, memberName: tree.Identifier | string): tree.MemberAccessExpression;
68
75
  static identifier(value: tree.Identifier | string, flags?: TokenFlags): tree.Identifier;
69
76
  static token<T extends TokenKind>(kind: T, value?: string): Token<T>;
70
77
  static keyword<T extends KeywordKind>(kind: T): tree.Keyword<T>;
@@ -18,6 +18,7 @@ export declare class SyntaxFactory {
18
18
  static methodDeclaration(tags: readonly tree.Tag[] | tree.TagList, name: tree.Identifier | string, typeParameters: readonly tree.TypeParameterDeclaration[] | tree.TypeParameterDeclarationList | undefined, parameters: readonly tree.ParameterDeclaration[] | tree.ParameterList, returnTypeSpecifier: tree.TypeSpecifier | undefined, body: tree.FunctionBlock | undefined): tree.MethodDeclaration;
19
19
  static indexedElementGetterDeclaration(tags: readonly tree.Tag[] | tree.TagList, parameters: readonly tree.ParameterDeclaration[] | tree.ParameterList, typeSpecifier: tree.TypeSpecifier, body: tree.FunctionBlock | undefined): tree.IndexedElementGetterDeclaration;
20
20
  static indexedElementSetterDeclaration(tags: readonly tree.Tag[] | tree.TagList, parameters: readonly tree.ParameterDeclaration[] | tree.ParameterList, body: tree.FunctionBlock | undefined): tree.IndexedElementSetterDeclaration;
21
+ static emptyFunctionBlock(): tree.FunctionBlock;
21
22
  static localStructuredTypeDeclaration(name: tree.Identifier | string, baseTypes: readonly tree.NamedTypeSpecifier[] | undefined, members: readonly tree.TypeMemberDeclaration[] | tree.TypeMemberDeclarationList): tree.LocalStructuredTypeDeclaration;
22
23
  static localFunctionTypeDeclaration(parameters: readonly tree.ParameterDeclaration[] | tree.ParameterList, returnTypeSpecifier: tree.TypeSpecifier | undefined): tree.LocalFunctionTypeDeclaration;
23
24
  static namedTypeSpecifier(name: tree.Identifier | string | readonly (tree.Identifier | string)[], typeArguments?: readonly tree.TypeSpecifier[]): tree.NamedTypeSpecifier;
@@ -53,6 +54,13 @@ export declare class SyntaxFactory {
53
54
  private static translationTypeParameterClause;
54
55
  private static translationParameterClause;
55
56
  private static createTranslationTypeParameterClause;
57
+ static argument(value: tree.Expression, name?: tree.Identifier | string): tree.Argument;
58
+ static missingExpression(): tree.MissingExpression;
59
+ static booleanLiteral(value: boolean): tree.KeywordExpression;
60
+ static textLiteral(valueWithoutQuotes: string): tree.TextLiteral;
61
+ static numericLiteral(value: number): tree.TokenExpression;
62
+ static identifierExpression(value: tree.Identifier | string): tree.IdentifierExpression;
63
+ static memberAccessExpression(expression: tree.Expression, memberName: tree.Identifier | string): tree.MemberAccessExpression;
56
64
  static identifier(value: tree.Identifier | string, flags?: TokenFlags): tree.Identifier;
57
65
  static token<T extends TokenKind>(kind: T, value?: string): Token<T>;
58
66
  static keyword<T extends KeywordKind>(kind: T): tree.Keyword<T>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artel/artc",
3
- "version": "0.9.26036-pre-release",
3
+ "version": "0.9.26038-pre-release",
4
4
  "description": "Артель Компилятор | Artel Compiler",
5
5
  "author": "Nezaboodka Team <contact@nezaboodka.com>",
6
6
  "license": "Apache-2.0",