@artel/artc 0.6.26023 → 0.6.26025

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.
Files changed (29) hide show
  1. package/build/Cli.js +3 -3
  2. package/build/api/Api.js +2 -2
  3. package/build/api/ApiNodeJS.js +3 -3
  4. package/build/api/ApiServices.js +19 -32
  5. package/build/{chunk-HAB6M5SG.js → chunk-7QPDALAB.js} +1 -1
  6. package/build/{chunk-IMUSLOYE.js → chunk-CIRH34IO.js} +2 -2
  7. package/build/{chunk-RQOGIK5O.js → chunk-OTHSFQXT.js} +431 -408
  8. package/build/types/analysis/Analyzer.d.ts +2 -2
  9. package/build/types/analysis/SpecialNameKey.d.ts +19 -19
  10. package/build/types/analysis/WellKnownDeclarations.d.ts +3 -0
  11. package/build/types/analysis/a/Analyzer.d.ts +10 -0
  12. package/build/types/analysis/a/TextIdentity.d.ts +3 -6
  13. package/build/types/analysis/a/semantic-context/SemanticContextBase.d.ts +2 -2
  14. package/build/types/analysis/a/semantic-context/SourceFileSemanticContext.d.ts +2 -2
  15. package/build/types/common/Name.d.ts +14 -30
  16. package/build/types/diagnostic/DiagnosticCode.d.ts +5 -9
  17. package/build/types/emitter/EmitterContext.d.ts +2 -0
  18. package/build/types/emitter/IrFactory.d.ts +3 -3
  19. package/build/types/emitter/ir/EmitOptions.d.ts +0 -1
  20. package/build/types/emitter/ir/Nodes.d.ts +10 -6
  21. package/build/types/entities/EntityNaming.d.ts +2 -2
  22. package/build/types/entities/PackageEntityMembers.d.ts +3 -3
  23. package/build/types/entities/interfaces/TextTranslationEntity.d.ts +1 -2
  24. package/build/types/entities/source/a/SourceTextTranslationEntity.d.ts +2 -2
  25. package/build/types/tree/a/Nodes.d.ts +12 -12
  26. package/build/types/tree/a/TokenFlags.d.ts +6 -8
  27. package/build/types/types/StandardTypes.d.ts +2 -0
  28. package/build/types/types/TypeFactory.d.ts +1 -1
  29. package/package.json +1 -1
@@ -281,8 +281,8 @@ declare class TypeAssignabilityCheck {
281
281
  /**
282
282
  * @example
283
283
  * ```artel
284
- * перем а = операция(п: Текст): Объект { }
285
- * перем б = операция(п: Объект): Текст { }
284
+ * перем а = функция(п: Текст): Объект { }
285
+ * перем б = функция(п: Объект): Текст { }
286
286
  *
287
287
  * а = б // Корректно
288
288
  * б = а // Ошибка
@@ -5,29 +5,29 @@ export declare const specialNameKeys: {
5
5
  readonly objectParameter: "-объект";
6
6
  readonly constructor: "-создание";
7
7
  readonly destructor: "-уничтожение";
8
- readonly plusOperator: "+";
9
- readonly unaryPlusOperator: "";
10
- readonly binaryPlusOperator: "";
11
- readonly minusOperator: "-";
12
- readonly unaryMinusOperator: "";
13
- readonly binaryMinusOperator: "";
8
+ readonly plusOperator: "-плюс";
9
+ readonly unaryPlusOperator: "-плюс-одноместный";
10
+ readonly binaryPlusOperator: "-плюс-двухместный";
11
+ readonly minusOperator: "-минус";
12
+ readonly unaryMinusOperator: "-минус-одноместный";
13
+ readonly binaryMinusOperator: "-минус-двухместный";
14
14
  readonly notOperator: "-не";
15
- readonly multiplyOperator: "*";
16
- readonly divideOperator: "/";
17
- readonly moduloOperator: "%";
18
- readonly lessThanOperator: "<";
19
- readonly greaterThanOperator: ">";
20
- readonly lessThanOrEqualOperator: "<=";
21
- readonly greaterThanOrEqualOperator: ">=";
15
+ readonly multiplyOperator: "-умножение";
16
+ readonly divideOperator: "-деление";
17
+ readonly moduloOperator: "-остаток";
18
+ readonly lessThanOperator: "-меньше";
19
+ readonly greaterThanOperator: "-больше";
20
+ readonly lessThanOrEqualOperator: "-меньше-или-равно";
21
+ readonly greaterThanOrEqualOperator: "-больше-или-равно";
22
22
  readonly orOperator: "-или";
23
23
  readonly andOperator: "-и";
24
24
  readonly xorOperator: "-искл";
25
- readonly bitwiseAndOperator: "&";
26
- readonly bitwiseOrOperator: "|";
27
- readonly bitwiseXorOperator: "||";
28
- readonly leftShiftOperator: "<<";
29
- readonly signedRightShiftOperator: ">>";
30
- readonly unsignedRightShiftOperator: ">>>";
25
+ readonly bitwiseAndOperator: "-побитовое-и";
26
+ readonly bitwiseOrOperator: "-побитовое-или";
27
+ readonly bitwiseXorOperator: "-побитовое-искл";
28
+ readonly leftShiftOperator: "-сдвиг-влево";
29
+ readonly signedRightShiftOperator: "-сдвиг-вправо";
30
+ readonly unsignedRightShiftOperator: "-сдвиг-вправо-нулями";
31
31
  };
32
32
  export declare const specialNames: { readonly [K in keyof typeof specialNameKeys]: Name; };
33
33
  export declare const specialNameBySyntacticalOperatorKind: {
@@ -13,6 +13,7 @@ export interface WellKnownDeclarations {
13
13
  readonly integer: StructuredTypeEntity;
14
14
  readonly text: StructuredTypeEntity;
15
15
  readonly textTemplate: StructuredTypeEntity;
16
+ readonly localizableTextTemplate: StructuredTypeEntity;
16
17
  readonly char: StructuredTypeEntity;
17
18
  readonly yesNo: StructuredTypeEntity;
18
19
  readonly nullEntity: StructuredTypeEntity;
@@ -47,6 +48,7 @@ export declare class LocalizedWellKnownDeclarations implements WellKnownDeclarat
47
48
  private integer_;
48
49
  private text_;
49
50
  private textTemplate_;
51
+ private localizableTextTemplate_;
50
52
  private char_;
51
53
  private yesNo_;
52
54
  private null_;
@@ -78,6 +80,7 @@ export declare class LocalizedWellKnownDeclarations implements WellKnownDeclarat
78
80
  get integer(): StructuredTypeEntity;
79
81
  get text(): StructuredTypeEntity;
80
82
  get textTemplate(): StructuredTypeEntity;
83
+ get localizableTextTemplate(): StructuredTypeEntity;
81
84
  get char(): StructuredTypeEntity;
82
85
  get yesNo(): StructuredTypeEntity;
83
86
  get nullEntity(): StructuredTypeEntity;
@@ -257,6 +257,7 @@ declare class Type {
257
257
  private ofDereferenceExpression;
258
258
  private ofConditionalExpression;
259
259
  private ofTextLiteral;
260
+ private ofLocalizableTextLiteral;
260
261
  /**
261
262
  * По умолчанию литерал шаблона текста имеет тип Текст.
262
263
  *
@@ -266,6 +267,15 @@ declare class Type {
266
267
  * и не содержащий тип Текст.
267
268
  */
268
269
  private ofTextTemplateLiteral;
270
+ /**
271
+ * По умолчанию литерал шаблона текста имеет тип Текст.
272
+ *
273
+ * Литерал переводимого шаблона текста имеет тип ШаблонТекстаПереводимый в следующих случаях:
274
+ * - если он присваивается в переменную, имеющую тип ШаблонТекстаПереводимый;
275
+ * - если он присваивается в переменную, имеющую союзный тип, содержащий тип ШаблонТекстаПереводимый
276
+ * и не содержащий тип Текст.
277
+ */
278
+ private ofLocalizableTextTemplateLiteral;
269
279
  private ofIdentifierExpression;
270
280
  private ofTokenExpression;
271
281
  private ofKeywordExpression;
@@ -1,9 +1,6 @@
1
- import { TextKey } from '../../entities/index.js';
2
1
  import * as tree from '../../tree/a/index.js';
3
2
  export declare class TextIdentity {
4
- static keyFromTextFragments(fragments: readonly string[]): TextKey;
5
- static keyFromTextToken(token: tree.Token<tree.TokenKind.TextLiteral>): TextKey;
6
- static keyFromLocalizableTextLiteral(node: tree.LocalizableTextLiteral): TextKey;
7
- static keyFromLocalizableTextTemplateLiteral(node: tree.LocalizableTextTemplateLiteral): TextKey;
8
- static keyFromTextTranslationSource(node: tree.TextTranslationSource): TextKey;
3
+ static keyFromLocalizableTextLiteral(node: tree.LocalizableTextLiteral): string;
4
+ static keyFromLocalizableTextTemplateLiteral(node: tree.LocalizableTextTemplateLiteral): string;
5
+ static keyFromTextTranslationSource(node: tree.TextTranslationSource): string;
9
6
  }
@@ -1,5 +1,5 @@
1
1
  import { Name } from '../../../common/index.js';
2
- import { AnonymousFunctionEntity, FunctionEntity, FunctionTypeEntity, GetterEntity, MethodEntity, NamedFunctionEntity, PackageEntity, ParameterEntity, SetterEntity, TextKey, TextTranslationEntity, TypeEntity, TypeEntityWithMembers, TypeExtensionEntity } from '../../../entities/index.js';
2
+ import { AnonymousFunctionEntity, FunctionEntity, FunctionTypeEntity, GetterEntity, MethodEntity, NamedFunctionEntity, PackageEntity, ParameterEntity, SetterEntity, TextTranslationEntity, TypeEntity, TypeEntityWithMembers, TypeExtensionEntity } from '../../../entities/index.js';
3
3
  import { SourceFileA } from '../../../project/SourceFile.js';
4
4
  import * as tree from '../../../tree/a/index.js';
5
5
  import * as types from '../../../types/index.js';
@@ -34,7 +34,7 @@ export declare abstract class SemanticContextBase implements TypeExtensionLookup
34
34
  getNamedDeclarations(noInstanceMembers?: boolean): readonly NamedDeclaration[];
35
35
  getNamedDeclarationsByName(name: Name, noInstanceMembers?: boolean): NamedDeclarationLookupResult;
36
36
  getTypeExtensionsByType(type: TypeEntity): readonly TypeExtensionEntity[];
37
- getTextTranslationEntityByTextKey(key: TextKey): readonly TextTranslationEntity[];
37
+ getTextTranslationEntityByTextKey(key: string): readonly TextTranslationEntity[];
38
38
  private semanticContexts;
39
39
  private getSourceFileContext;
40
40
  }
@@ -1,6 +1,6 @@
1
1
  import { Name } from '../../../common/index.js';
2
2
  import { DiagnosticAcceptor } from '../../../diagnostic/Diagnostic.js';
3
- import { PackageEntity, TextKey, TextTranslationEntity, TypeEntity, TypeExtensionEntity } from '../../../entities/index.js';
3
+ import { PackageEntity, TextTranslationEntity, TypeEntity, TypeExtensionEntity } from '../../../entities/index.js';
4
4
  import { SourceFileA } from '../../../project/SourceFile.js';
5
5
  import * as tree from '../../../tree/a/index.js';
6
6
  import { DiagnosticArgumentFactory } from '../../DiagnosticArgumentFactory.js';
@@ -45,7 +45,7 @@ export declare class SourceFileSemanticContext extends SemanticContextBase {
45
45
  getOwnNamedDeclarations(initialContext: SemanticContext, _noInstanceMembers: boolean, _lookupState: SemanticContextLookupState): NamedDeclaration[];
46
46
  getOwnNamedDeclarationsByName(name: Name, initialContext: SemanticContext, _noInstanceMembers: boolean, lookupResult: NamedDeclarationLookupResult): void;
47
47
  getOwnTypeExtensionsByType(type: TypeEntity, initialContext: SemanticContext): TypeExtensionEntity[];
48
- getTextTranslationEntityByTextKey(key: TextKey): readonly TextTranslationEntity[];
48
+ getTextTranslationEntityByTextKey(key: string): readonly TextTranslationEntity[];
49
49
  validateNameConflicts(diagnostics: DiagnosticAcceptor): void;
50
50
  private convertPackageMemberToNamedDeclaration;
51
51
  private convertPackageAliasToTypeOrContainerWithTypes;
@@ -13,46 +13,31 @@ export declare const enum NameFlags {
13
13
  */
14
14
  RequiresQuotes = 4,
15
15
  /**
16
- * Имя с обратным апострофом для избежания конфликта между параметром метода и свойством объекта,
17
- * например: имя\`, 'имя с пробелами'\`.
16
+ * Имя является специальным и начинается со знака '-': '-объект', '-создание', '-плюс'.
18
17
  */
19
- ConflictResolvingParameterName = 8,
20
- /**
21
- * Имя с двойным обратным апострофом для избежания конфликта между вычисляемым свойством и скрытой
22
- * хранимой переменной объекта, например: длина\`\`, 'имя с пробелами'\`\`.
23
- */
24
- BackingVariableName = 16,
18
+ SpecialName = 8,
25
19
  /**
26
20
  * Конвертировать имя в формат kebab case при формировании исходного имени.
27
21
  */
28
- PreferKebabCase = 32
22
+ PreferKebabCase = 16
29
23
  }
30
24
  export declare class Name implements Displayable {
31
- static readonly objectParameterNameKey = "-object";
32
25
  /**
33
- * Исходное имя без одиночных кавычек и без символов '\`' в конце.
26
+ * Исходное имя без одиночных кавычек и без символов апострофа ` в конце.
34
27
  */
35
28
  readonly unescapedOriginalWithoutQuotes: string;
36
29
  /**
37
- * Флаги, указывающие на наличии у имени символов '\`', одиночных кавычек и их смысл.
30
+ * Флаги, указывающие на наличии у имени символов апострофа и одиночных кавычек.
38
31
  */
39
32
  readonly flags: NameFlags;
40
33
  /**
41
- * Ключ, используемый для сравнения имён на эквивалентность без учёта флагов, а также для генерации кода.
34
+ * Ключ, используемый для сравнения имён на эквивалентность.
42
35
  * Получается из исходного имени путём:
43
- * 1. удаления символов символов '\`' из конца имени и удаления одиночных кавычек из остатка;
44
- * 2. удаления символов '-' и замены первых следующих за ними букв на заглавные.
45
- */
46
- readonly keyWithoutBackQuotes: string;
47
- /**
48
- * Ключ, используемый для сравнения имён на эквивалентность с учётом флагов. Получается из
49
- * `keyWithoutBackQuotes` путём добавления символов '\`' `meaningfulBackQuoteCount` число раз.
50
- */
51
- get key(): string;
52
- /**
53
- * Количество значащих символов '`', соответствующих флагам.
36
+ * 1. удаления одиночных кавычек для имён, которые являются обычными именами;
37
+ * 2. удаления символов '-' и замены первых следующих за ними букв на заглавные;
38
+ * Апострофы в конце сохраняются.
54
39
  */
55
- get meaningfulBackQuoteCount(): number;
40
+ readonly key: string;
56
41
  /**
57
42
  * Исходное имя, при необходимости взятое в одиночные кавычки и содержащее обратные кавычки согласно флагам.
58
43
  */
@@ -61,13 +46,12 @@ export declare class Name implements Displayable {
61
46
  * @param unescapedOriginalWithoutQuotes Исходное имя без апострофов, одиночных кавычек и экранирования.
62
47
  * @param flags Флаги имени (`NameFlags`). `NameFlags.None` по умолчанию.
63
48
  */
64
- constructor(unescapedOriginalWithoutQuotes: string, flags?: NameFlags, specialKey?: string);
65
- toConflictResolvingParameterName(): Name;
49
+ constructor(unescapedOriginalWithoutQuotes: string, flags?: NameFlags);
66
50
  toBackingVariableName(): Name;
67
- considerEqual(other: Name, considerBackQuotes?: boolean): boolean;
51
+ considerEqual(other: Name): boolean;
68
52
  toString(): string;
69
- getPreferredUnescapedOriginal(flags: NameFlags): string;
53
+ getPreferredUnescapedOriginal(requiresQuotes?: boolean): string;
70
54
  getDisplayText(): string;
71
- static parse(original: string, initialFlags?: NameFlags, specialKey?: string): Name;
55
+ static parse(original: string, initialFlags?: NameFlags): Name;
72
56
  private static toUnescapedOriginal;
73
57
  }
@@ -27,15 +27,11 @@ export declare enum DiagnosticCode {
27
27
  ModifierListExpected = 1120,
28
28
  RunKeywordCreationKeywordOrModifierListExpected = 1121,
29
29
  HidingLevelExpected = 1122,
30
- ParameterNameCanContainOnlyOneBackQuote = 1123,
31
- FieldNameCanContainOnlyTwoBackQuote = 1124,
32
- BackQuotesCanOnlyBeUsedInParameterAndFieldNames = 1125,
33
- NameThatMatchesKeywordMustBeEnclosedInSingleQuotes = 1126,
34
- TagNameExpected = 1127,
35
- TypeMemberTranslationExpected = 1128,
36
- TranslationExpected = 1129,
37
- TranslatedTextTemplateOrTranslationFunctionBlockExpected = 1130,
38
- TranslatedTextCannotBeginOrEndWithTilde = 1131,
30
+ TagNameExpected = 1123,
31
+ TypeMemberTranslationExpected = 1124,
32
+ TranslationExpected = 1125,
33
+ TranslatedTextTemplateOrTranslationFunctionBlockExpected = 1126,
34
+ TranslatedTextCannotBeginOrEndWithTilde = 1127,
39
35
  TypeCannotBeUsedAsValue = 2000,
40
36
  PackageNameCannotBeUsedAsValue = 2001,
41
37
  PackageAliasCannotBeUsedAsValue = 2002,
@@ -68,6 +68,7 @@ declare class StandardTypes {
68
68
  private array_;
69
69
  private func_;
70
70
  private textTemplate_;
71
+ private localizableTextTemplate_;
71
72
  private reference_;
72
73
  get nullType(): Type;
73
74
  get yesNo(): Type;
@@ -80,6 +81,7 @@ declare class StandardTypes {
80
81
  get array(): Type;
81
82
  get func(): Type;
82
83
  get textTemplate(): Type;
84
+ get localizableTextTemplate(): Type;
83
85
  get reference(): Type;
84
86
  constructor(analyzer: Analyzer, entityMap: EntityMap);
85
87
  }
@@ -89,10 +89,10 @@ export declare function switchStatement(matchExpression: ir.Expression, caseClau
89
89
  export declare function caseClause(expressions: readonly ir.Expression[], body: ir.BlockStatement, sourceLocation?: ir.SourceLocation): ir.CaseClause;
90
90
  export declare function ternaryExpression(condition: ir.Expression, firstExpression: ir.Expression, secondExpression: ir.Expression, sourceLocation?: ir.SourceLocation): ir.TernaryExpression;
91
91
  export declare function textLiteral(value: string, sourceLocation?: ir.SourceLocation): ir.TextLiteral;
92
- export declare function localizableTextLiteral(value: string, code: number | undefined, sourceLocation?: ir.SourceLocation): ir.LocalizableTextLiteral;
92
+ export declare function localizableTextLiteral(value: string, key: string | undefined, sourceLocation?: ir.SourceLocation): ir.LocalizableTextLiteral;
93
93
  export declare function textWithEntityName(entity: NamedEntity, sourceLocation?: ir.SourceLocation): ir.TextWithEntityName;
94
94
  export declare function textTemplateLiteral(textFragments: readonly string[], expressions: readonly ir.Expression[], sourceLocation?: ir.SourceLocation): ir.TextTemplateLiteral;
95
- export declare function localizableTextTemplateLiteral(textFragments: readonly string[], expressions: readonly ir.Expression[], code: number | undefined, sourceLocation?: ir.SourceLocation): ir.LocalizableTextTemplateLiteral;
95
+ export declare function localizableTextTemplateLiteral(textFragments: readonly string[], expressions: readonly ir.Expression[], key: string | undefined, sourceLocation?: ir.SourceLocation): ir.LocalizableTextTemplateLiteral;
96
96
  export declare function thisExpression(type: Type, sourceLocation?: ir.SourceLocation): ir.ThisExpression;
97
97
  export declare function typeAccessExpression(entity: TypeOrExtensionEntity, sourceLocation?: ir.SourceLocation): ir.TypeAccessExpression;
98
98
  export declare function constructorDeclaration(entity: FunctionEntity, parameters: readonly ir.ParameterDeclaration[], body: ir.BlockStatement, sourceLocation?: ir.SourceLocation): ir.ConstructorDeclaration;
@@ -115,7 +115,7 @@ export declare function fieldSetterDeclaration(entity: FunctionEntity, body: ir.
115
115
  export declare function parameterDeclaration(entity: VariableEntity, defaultValue: ir.Expression | undefined, isRest: boolean, sourceLocation?: ir.SourceLocation): ir.ParameterDeclaration;
116
116
  export declare function whileStatement(label: string | undefined, condition: ir.Expression, body: ir.BlockStatement, sourceLocation?: ir.SourceLocation): ir.WhileStatement;
117
117
  export declare function yieldStatement(expression: ir.Expression, sourceLocation?: ir.SourceLocation): ir.YieldStatement;
118
- export declare function textTranslationDeclaration(key: string | number, sourceTextTemplate: ir.TranslationTextTemplate | undefined, translatedTextOrFunctionBlock: ir.TextLiteral | ir.BlockStatement, sourceLocation?: ir.SourceLocation): ir.TextTranslationDeclaration;
118
+ export declare function textTranslationDeclaration(key: string, sourceTextTemplate: ir.TranslationTextTemplate | undefined, translatedTextOrFunctionBlock: ir.TextLiteral | ir.BlockStatement, sourceLocation?: ir.SourceLocation): ir.TextTranslationDeclaration;
119
119
  export declare function translationTextTemplate(fragments: readonly string[], parameters: readonly VariableEntity[], sourceLocation?: ir.SourceLocation): ir.TranslationTextTemplate;
120
120
  export declare function constructorCallExpression(ectx: EmitterContext, constructor: FunctionEntity, args: readonly ir.Expression[] | ir.Arguments, sourceLocation?: ir.SourceLocation): ir.ConstructorCallExpression;
121
121
  export declare function constructorCallExpressionWithResultType(constructor: FunctionEntity, args: readonly ir.Expression[] | ir.Arguments, type: Type, sourceLocation?: ir.SourceLocation): ir.ConstructorCallExpression;
@@ -70,7 +70,6 @@ export declare class TextTemplateEmitOptions {
70
70
  private flags;
71
71
  constructor(flags?: TextTemplateEmitOptionsFlags);
72
72
  constructor(createTextTemplateInstance: boolean);
73
- static default(): TextTemplateEmitOptions;
74
73
  get createTextTemplateInstance(): boolean;
75
74
  set createTextTemplateInstance(value: boolean);
76
75
  setCreateTextTemplateInstance(value: boolean): this;
@@ -712,15 +712,19 @@ export declare class TextLiteral {
712
712
  value: string;
713
713
  sourceLocation?: SourceLocation | undefined;
714
714
  readonly kind = NodeKind.TextLiteral;
715
+ options: TextTemplateEmitOptions;
715
716
  constructor(value: string, sourceLocation?: SourceLocation | undefined);
717
+ withOptions(options: TextTemplateEmitOptions): this;
716
718
  clone(): TextLiteral;
717
719
  }
718
720
  export declare class LocalizableTextLiteral {
719
721
  value: string;
720
- code: number | undefined;
722
+ key: string | undefined;
721
723
  sourceLocation?: SourceLocation | undefined;
722
724
  readonly kind = NodeKind.LocalizableTextLiteral;
723
- constructor(value: string, code: number | undefined, sourceLocation?: SourceLocation | undefined);
725
+ options: TextTemplateEmitOptions;
726
+ constructor(value: string, key: string | undefined, sourceLocation?: SourceLocation | undefined);
727
+ withOptions(options: TextTemplateEmitOptions): this;
724
728
  clone(): LocalizableTextLiteral;
725
729
  }
726
730
  /**
@@ -748,11 +752,11 @@ export declare class TextTemplateLiteral {
748
752
  export declare class LocalizableTextTemplateLiteral {
749
753
  textFragments: readonly string[];
750
754
  expressions: readonly Expression[];
751
- code: number | undefined;
755
+ key: string | undefined;
752
756
  sourceLocation?: SourceLocation | undefined;
753
757
  readonly kind = NodeKind.LocalizableTextTemplateLiteral;
754
758
  options: TextTemplateEmitOptions;
755
- constructor(textFragments: readonly string[], expressions: readonly Expression[], code: number | undefined, sourceLocation?: SourceLocation | undefined);
759
+ constructor(textFragments: readonly string[], expressions: readonly Expression[], key: string | undefined, sourceLocation?: SourceLocation | undefined);
756
760
  withOptions(options: TextTemplateEmitOptions): this;
757
761
  clone(): LocalizableTextTemplateLiteral;
758
762
  }
@@ -976,12 +980,12 @@ export declare class YieldStatement {
976
980
  clone(): YieldStatement;
977
981
  }
978
982
  export declare class TextTranslationDeclaration {
979
- key: string | number;
983
+ key: string;
980
984
  sourceTextTemplate: TranslationTextTemplate | undefined;
981
985
  translatedTextOrFunctionBlock: TextLiteral | BlockStatement;
982
986
  sourceLocation?: SourceLocation | undefined;
983
987
  readonly kind = NodeKind.TextTranslationDeclaration;
984
- constructor(key: string | number, sourceTextTemplate: TranslationTextTemplate | undefined, translatedTextOrFunctionBlock: TextLiteral | BlockStatement, sourceLocation?: SourceLocation | undefined);
988
+ constructor(key: string, sourceTextTemplate: TranslationTextTemplate | undefined, translatedTextOrFunctionBlock: TextLiteral | BlockStatement, sourceLocation?: SourceLocation | undefined);
985
989
  clone(): TextTranslationDeclaration;
986
990
  }
987
991
  export declare class TranslationTextTemplate {
@@ -5,10 +5,10 @@ export declare class EntityNaming_named {
5
5
  readonly kind = "named";
6
6
  constructor(value: Name);
7
7
  toString(): string;
8
- considerEqual(other: EntityNaming, considerBackQuotes: boolean): boolean;
8
+ considerEqual(other: EntityNaming): boolean;
9
9
  }
10
10
  export declare class EntityNaming_anonymous {
11
11
  readonly kind = "anonymous";
12
12
  toString(): string;
13
- considerEqual(other: EntityNaming, _considerBackQuotes: boolean): boolean;
13
+ considerEqual(other: EntityNaming): boolean;
14
14
  }
@@ -1,5 +1,5 @@
1
1
  import { Name } from '../common/index.js';
2
- import { NamedPackageMemberEntity, TextKey, TextTranslationEntity, TypeEntity, TypeExtensionEntity } from './index.js';
2
+ import { NamedPackageMemberEntity, TextTranslationEntity, TypeEntity, TypeExtensionEntity } from './index.js';
3
3
  export declare class PackageEntityMembers {
4
4
  private readonly namedMembers;
5
5
  private readonly typeExtensions;
@@ -9,13 +9,13 @@ export declare class PackageEntityMembers {
9
9
  private readonly membersByNameKey_;
10
10
  private readonly textTranslationsByTextKey_;
11
11
  private get membersByNameKey();
12
- get textTranslationsByTextKey(): ReadonlyMap<TextKey, readonly TextTranslationEntity[]>;
12
+ get textTranslationsByTextKey(): ReadonlyMap<string, readonly TextTranslationEntity[]>;
13
13
  constructor(namedMembers: readonly NamedPackageMemberEntity[], typeExtensions: readonly TypeExtensionEntity[], textTranslations: readonly TextTranslationEntity[]);
14
14
  getNamedMembers(): readonly NamedPackageMemberEntity[];
15
15
  getNamedMembersByName(name: Name): readonly NamedPackageMemberEntity[];
16
16
  getTypeExtensions(): readonly TypeExtensionEntity[];
17
17
  getTypeExtensionsByType(type: TypeEntity): readonly TypeExtensionEntity[];
18
18
  getTextTranslations(): readonly TextTranslationEntity[];
19
- getTextTranslationsByTextKey(key: TextKey): readonly TextTranslationEntity[];
19
+ getTextTranslationsByTextKey(key: string): readonly TextTranslationEntity[];
20
20
  getNamedMembersAndTypeExtensions(): Iterable<NamedPackageMemberEntity | TypeExtensionEntity>;
21
21
  }
@@ -4,7 +4,7 @@ import { DefinitionKind, EntityHidingLevel, EntityKind, ParameterEntity } from '
4
4
  export interface TextTranslationEntity extends IEntity {
5
5
  readonly kind: EntityKind.TextTranslation;
6
6
  isTextTemplate(): boolean;
7
- getKey(): TextKey;
7
+ getKey(): string;
8
8
  getText(): string;
9
9
  getTextFragments(): readonly string[];
10
10
  getComment(): string | undefined;
@@ -13,7 +13,6 @@ export interface TextTranslationEntity extends IEntity {
13
13
  isHidden(): EntityHidingLevel | undefined;
14
14
  getOriginalEntity(): TextTranslationEntity;
15
15
  }
16
- export type TextKey = string | number;
17
16
  export type TextTranslationEntityDefinition = {
18
17
  kind: DefinitionKind.Source;
19
18
  node: treeA.TextTranslationSource;
@@ -1,7 +1,7 @@
1
1
  import { Analyzer } from '../../../analysis/a/Analyzer.js';
2
2
  import { PackageDialect, PackageLocale } from '../../../common/index.js';
3
3
  import * as tree from '../../../tree/a/index.js';
4
- import { EntityHidingLevel, EntityKind, PackageEntity, ParameterEntity, Tag, TextKey, TextTranslationEntity, TextTranslationEntityDefinition, Translation } from '../../index.js';
4
+ import { EntityHidingLevel, EntityKind, PackageEntity, ParameterEntity, Tag, TextTranslationEntity, TextTranslationEntityDefinition, Translation } from '../../index.js';
5
5
  export declare class TextTranslationDeclarationEntity implements TextTranslationEntity {
6
6
  private readonly analyzer;
7
7
  private readonly node;
@@ -13,7 +13,7 @@ export declare class TextTranslationDeclarationEntity implements TextTranslation
13
13
  private readonly comment;
14
14
  constructor(analyzer: Analyzer, node: tree.TextTranslationSource);
15
15
  isTextTemplate(): boolean;
16
- getKey(): TextKey;
16
+ getKey(): string;
17
17
  getText(): string;
18
18
  getTextFragments(): readonly string[];
19
19
  getParameters(): readonly ParameterEntity[];
@@ -1209,14 +1209,14 @@ export declare class LocalizableTextTemplateLiteral extends BaseExpressionNode {
1209
1209
  readonly children: readonly [
1210
1210
  TextTemplateHead,
1211
1211
  TextTemplateSpanList,
1212
- Token<TokenKind.IntegerLiteral> | undefined
1212
+ Token<TokenKind.TextLiteral> | undefined
1213
1213
  ];
1214
1214
  get parent(): ExpressionParent;
1215
1215
  get head(): TextTemplateHead;
1216
1216
  get spanList(): TextTemplateSpanList;
1217
- get code(): Token<TokenKind.IntegerLiteral> | undefined;
1217
+ get key(): Token<TokenKind.TextLiteral> | undefined;
1218
1218
  protected get thisAsNode(): Expression;
1219
- constructor(head: TextTemplateHead, spanList: TextTemplateSpanList, code: Token<TokenKind.IntegerLiteral> | undefined, rangeWithTrivia: Range | undefined);
1219
+ constructor(head: TextTemplateHead, spanList: TextTemplateSpanList, key: Token<TokenKind.TextLiteral> | undefined, rangeWithTrivia: Range | undefined);
1220
1220
  }
1221
1221
  export type TextTemplateSpanListParent = TextTemplateLiteral | LocalizableTextTemplateLiteral;
1222
1222
  export declare class TextTemplateSpanList extends BaseNode {
@@ -1267,13 +1267,13 @@ export declare class LocalizableTextLiteral extends BaseExpressionNode {
1267
1267
  readonly kind = NodeKind.LocalizableTextLiteral;
1268
1268
  readonly children: readonly [
1269
1269
  Token<TokenKind.TextLiteral>,
1270
- Token<TokenKind.IntegerLiteral> | undefined
1270
+ Token<TokenKind.TextLiteral> | undefined
1271
1271
  ];
1272
1272
  get parent(): ExpressionParent;
1273
1273
  get text(): Token<TokenKind.TextLiteral>;
1274
- get code(): Token<TokenKind.IntegerLiteral> | undefined;
1274
+ get key(): Token<TokenKind.TextLiteral> | undefined;
1275
1275
  protected get thisAsNode(): Expression;
1276
- constructor(text: Token<TokenKind.TextLiteral>, code: Token<TokenKind.IntegerLiteral> | undefined, rangeWithTrivia: Range | undefined);
1276
+ constructor(text: Token<TokenKind.TextLiteral>, key: Token<TokenKind.TextLiteral> | undefined, rangeWithTrivia: Range | undefined);
1277
1277
  }
1278
1278
  export declare class KeywordExpression extends BaseExpressionNode {
1279
1279
  readonly kind = NodeKind.KeywordExpression;
@@ -2051,27 +2051,27 @@ export declare class TranslationTextLiteral extends BaseNode {
2051
2051
  readonly kind = NodeKind.TranslationTextLiteral;
2052
2052
  readonly children: readonly [
2053
2053
  Token<TokenKind.TextLiteral>,
2054
- Token<TokenKind.IntegerLiteral> | undefined
2054
+ Token<TokenKind.TextLiteral> | undefined
2055
2055
  ];
2056
2056
  get parent(): TranslationTextParent;
2057
2057
  get text(): Token<TokenKind.TextLiteral>;
2058
- get code(): Token<TokenKind.IntegerLiteral> | undefined;
2058
+ get key(): Token<TokenKind.TextLiteral> | undefined;
2059
2059
  protected get thisAsNode(): Node;
2060
- constructor(text: Token<TokenKind.TextLiteral>, code: Token<TokenKind.IntegerLiteral> | undefined, rangeWithTrivia: Range | undefined);
2060
+ constructor(text: Token<TokenKind.TextLiteral>, key: Token<TokenKind.TextLiteral> | undefined, rangeWithTrivia: Range | undefined);
2061
2061
  }
2062
2062
  export declare class TranslationTextTemplate extends BaseNode {
2063
2063
  readonly kind = NodeKind.TranslationTextTemplate;
2064
2064
  readonly children: readonly [
2065
2065
  TextTemplateHead,
2066
2066
  TranslationTextTemplateSpanList,
2067
- Token<TokenKind.IntegerLiteral> | undefined
2067
+ Token<TokenKind.TextLiteral> | undefined
2068
2068
  ];
2069
2069
  get parent(): TranslationTextParent;
2070
2070
  get head(): TextTemplateHead;
2071
2071
  get spanList(): TranslationTextTemplateSpanList;
2072
- get code(): Token<TokenKind.IntegerLiteral> | undefined;
2072
+ get key(): Token<TokenKind.TextLiteral> | undefined;
2073
2073
  protected get thisAsNode(): Node;
2074
- constructor(head: TextTemplateHead, spanList: TranslationTextTemplateSpanList, code: Token<TokenKind.IntegerLiteral> | undefined, rangeWithTrivia: Range | undefined);
2074
+ constructor(head: TextTemplateHead, spanList: TranslationTextTemplateSpanList, key: Token<TokenKind.TextLiteral> | undefined, rangeWithTrivia: Range | undefined);
2075
2075
  }
2076
2076
  export declare class TranslationTextTemplateSpanList extends BaseNode {
2077
2077
  readonly kind = NodeKind.TranslationTextTemplateSpanList;
@@ -5,12 +5,10 @@ export declare const enum TokenFlags {
5
5
  QuotedName = 4,// 'имя', 'имя с пробелами', '+'
6
6
  RequiresQuotes = 8,// 'имя с пробелами', '+'
7
7
  EscapedKeyword = 16,// 'выполнить'
8
- HasBackQuotes = 32,// имя с любым количеством апострофов: имя`, имя```
9
- ConflictResolvingParameterName = 64,// имя с одним апострофом: имя`, выполнить`
10
- BackingVariableName = 128,// имя с двумя апострофами: имя``, выполнить``
11
- SingleCharText = 256,// текст из одного символа: "а", "\/", "ю000А"
12
- StartsWithTilde = 512,// переводимый текст: ~"текст", ~"текст{
13
- EndsWithTilde = 1024,// переводимый текст: "текст"~, }текст"~
14
- ObjectParameterName = 2048,// имя особого параметра "объект"
15
- LocalizableText = 1536
8
+ HasBackQuotes = 32,// имя с любым количеством апострофов: имя`, имя``, имя```
9
+ SingleCharText = 64,// текст из одного символа: "а", "\/", "ю000А"
10
+ StartsWithTilde = 128,// переводимый текст: ~"текст", ~"текст{
11
+ EndsWithTilde = 256,// переводимый текст: "текст"~, }текст"~
12
+ ObjectParameterName = 512,// имя особого параметра "объект"
13
+ LocalizableText = 384
16
14
  }
@@ -11,6 +11,7 @@ export declare class StandardTypes {
11
11
  private integer_;
12
12
  private text_;
13
13
  private textTemplate_;
14
+ private localizableTextTemplate_;
14
15
  private char_;
15
16
  private unresolved_;
16
17
  private yesNo_;
@@ -30,6 +31,7 @@ export declare class StandardTypes {
30
31
  get integer(): StructuredType;
31
32
  get text(): StructuredType;
32
33
  get textTemplate(): StructuredType;
34
+ get localizableTextTemplate(): StructuredType;
33
35
  get char(): StructuredType;
34
36
  get unresolved(): UnresolvedType;
35
37
  get yesNo(): StructuredType;
@@ -14,7 +14,7 @@ export declare class TypeFactory {
14
14
  readonly analyzer: Analyzer;
15
15
  constructor(analyzer: Analyzer);
16
16
  getStructuredType(entity: StructuredTypeEntity, substitutions: Substitutions): StructuredType;
17
- getParameterType(entity: TypeParameterEntity, excludeNone: boolean): ParameterType;
17
+ getParameterType(entity: TypeParameterEntity, excludeNull: boolean): ParameterType;
18
18
  getVariantType(entity: VariantTypeEntity, substitutions: Substitutions): VariantType;
19
19
  getFunctionType(entity: FunctionTypeEntity, substitutions: Substitutions): FunctionType;
20
20
  getAliasType(entity: AliasTypeEntity, substitutions: Substitutions): AliasType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@artel/artc",
3
- "version": "0.6.26023",
3
+ "version": "0.6.26025",
4
4
  "description": "Артель Компилятор | Artel Compiler",
5
5
  "author": "Nezaboodka Team <contact@nezaboodka.com>",
6
6
  "license": "Apache-2.0",