@rsconcept/domain 1.7.4 → 1.7.6

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 (48) hide show
  1. package/dist/{analyzer-QxWs73gP.d.ts → analyzer-DqjdciC5.d.ts} +3 -3
  2. package/dist/{arguments-extractor-1acwjQNc.d.ts → arguments-extractor-Dd1lFom9.d.ts} +2 -2
  3. package/dist/{ast-annotations-CtF7C9uK.d.ts → ast-annotations-CZCzs9Uk.d.ts} +3 -3
  4. package/dist/{calculator-REeX2ZS1.d.ts → calculator-Dt03dsnd.d.ts} +3 -3
  5. package/dist/{error-toW0TUHF.d.ts → error-CzIbnP-N.d.ts} +3 -3
  6. package/dist/index.d.ts +9 -9
  7. package/dist/library/rsengine.d.ts +1 -1
  8. package/dist/library/rsform-api.d.ts +2 -2
  9. package/dist/library/rsform.d.ts +2 -2
  10. package/dist/library/rsmodel-api.d.ts +1 -1
  11. package/dist/library/structure-planner.d.ts +1 -1
  12. package/dist/rslang/api.d.ts +1 -1
  13. package/dist/rslang/ast-annotations.d.ts +1 -1
  14. package/dist/rslang/error.d.ts +1 -1
  15. package/dist/rslang/error.js +4 -3
  16. package/dist/rslang/error.js.map +1 -1
  17. package/dist/rslang/eval/calculator.d.ts +1 -1
  18. package/dist/rslang/eval/evaluator.d.ts +1 -1
  19. package/dist/rslang/eval/value-api.d.ts +1 -1
  20. package/dist/rslang/index.d.ts +9 -9
  21. package/dist/rslang/labels.d.ts +1 -1
  22. package/dist/rslang/parser/syntax-errors/index.d.ts +2 -2
  23. package/dist/rslang/semantic/analyzer.d.ts +1 -1
  24. package/dist/rslang/semantic/arguments-extractor.d.ts +1 -1
  25. package/dist/rslang/semantic/type-auditor.d.ts +2 -2
  26. package/dist/rslang/semantic/type-auditor.js +11 -13
  27. package/dist/rslang/semantic/type-auditor.js.map +1 -1
  28. package/dist/rslang/semantic/typification-api.d.ts +4 -2
  29. package/dist/rslang/semantic/typification-api.js +17 -1
  30. package/dist/rslang/semantic/typification-api.js.map +1 -1
  31. package/dist/rslang/semantic/typification-parser.d.ts +1 -1
  32. package/dist/rslang/semantic/typification.d.ts +2 -2
  33. package/dist/rslang/semantic/typification.js +11 -3
  34. package/dist/rslang/semantic/typification.js.map +1 -1
  35. package/dist/rslang/semantic/value-auditor.d.ts +1 -1
  36. package/dist/rslang/typification-graph.d.ts +1 -1
  37. package/dist/{typification-Dk-fisgO.d.ts → typification-DDuv88ir.d.ts} +7 -3
  38. package/dist/{typification-graph-6HcZ-rKH.d.ts → typification-graph-8VdK6_Fh.d.ts} +2 -2
  39. package/dist/{typification-parser-BBVx1RxP.d.ts → typification-parser-DHO42ZRc.d.ts} +2 -2
  40. package/dist/{value-api-B6T6f4Ia.d.ts → value-api-C2X4Pom5.d.ts} +2 -2
  41. package/package.json +4 -4
  42. package/src/rslang/error.ts +6 -3
  43. package/src/rslang/semantic/analyzer.test.ts +8 -0
  44. package/src/rslang/semantic/type-auditor.test.ts +19 -1
  45. package/src/rslang/semantic/type-auditor.ts +13 -12
  46. package/src/rslang/semantic/typification-api.test.ts +19 -2
  47. package/src/rslang/semantic/typification-api.ts +15 -0
  48. package/src/rslang/semantic/typification.ts +12 -2
@@ -1,6 +1,6 @@
1
1
  import { t as AstNode } from "./ast-C8sIpKdL.js";
2
- import { f as ExpressionType, g as TypeClass } from "./typification-Dk-fisgO.js";
3
- import { i as RSErrorDescription } from "./error-toW0TUHF.js";
2
+ import { f as ExpressionType, g as TypeClass } from "./typification-DDuv88ir.js";
3
+ import { i as RSErrorDescription } from "./error-CzIbnP-N.js";
4
4
  import { t as ValueClass } from "./value-class-CNI-lqXJ.js";
5
5
 
6
6
  //#region src/rslang/semantic/analyzer.d.ts
@@ -36,4 +36,4 @@ declare class RSLangAnalyzer {
36
36
  }
37
37
  //#endregion
38
38
  export { RSLangAnalyzer as a, AnalysisOptions as i, AnalysisFast as n, AnalysisFull as r, AnalysisBase as t };
39
- //# sourceMappingURL=analyzer-QxWs73gP.d.ts.map
39
+ //# sourceMappingURL=analyzer-DqjdciC5.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { t as AstNode } from "./ast-C8sIpKdL.js";
2
- import { f as ExpressionType } from "./typification-Dk-fisgO.js";
2
+ import { f as ExpressionType } from "./typification-DDuv88ir.js";
3
3
 
4
4
  //#region src/rslang/semantic/arguments-extractor.d.ts
5
5
  /** Represents function argument definition. */
@@ -35,4 +35,4 @@ declare class ArgumentsExtractor {
35
35
  }
36
36
  //#endregion
37
37
  export { ArgumentsType as n, ArgumentsExtractor as t };
38
- //# sourceMappingURL=arguments-extractor-1acwjQNc.d.ts.map
38
+ //# sourceMappingURL=arguments-extractor-Dd1lFom9.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { t as AstNode } from "./ast-C8sIpKdL.js";
2
- import { f as ExpressionType } from "./typification-Dk-fisgO.js";
3
- import { a as RSErrorInfo, r as RSErrorCode } from "./error-toW0TUHF.js";
2
+ import { f as ExpressionType } from "./typification-DDuv88ir.js";
3
+ import { a as RSErrorInfo, r as RSErrorCode } from "./error-CzIbnP-N.js";
4
4
 
5
5
  //#region src/rslang/ast-annotations.d.ts
6
6
  /** Appends {@link ExpressionType} onto the node's `annotation.rsType`. */
@@ -13,4 +13,4 @@ declare function annotateError(node: AstNode, code: RSErrorCode, params?: readon
13
13
  declare function readErrorAnnotation(node: AstNode): RSErrorInfo | null;
14
14
  //#endregion
15
15
  export { readTypeAnnotation as i, annotateType as n, readErrorAnnotation as r, annotateError as t };
16
- //# sourceMappingURL=ast-annotations-CtF7C9uK.d.ts.map
16
+ //# sourceMappingURL=ast-annotations-CZCzs9Uk.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { t as AstNode } from "./ast-C8sIpKdL.js";
2
- import { f as ExpressionType } from "./typification-Dk-fisgO.js";
3
- import { i as RSErrorDescription } from "./error-toW0TUHF.js";
2
+ import { f as ExpressionType } from "./typification-DDuv88ir.js";
3
+ import { i as RSErrorDescription } from "./error-CzIbnP-N.js";
4
4
  import { l as Value } from "./value-BduA_ZGp.js";
5
5
 
6
6
  //#region src/rslang/eval/calculator.d.ts
@@ -36,4 +36,4 @@ declare class RSCalculator {
36
36
  }
37
37
  //#endregion
38
38
  export { CalculatorResult as n, RSCalculator as r, CalculatorEvaluateOptions as t };
39
- //# sourceMappingURL=calculator-REeX2ZS1.d.ts.map
39
+ //# sourceMappingURL=calculator-Dt03dsnd.d.ts.map
@@ -44,11 +44,11 @@ declare const RSErrorCode: {
44
44
  readonly expectedArgument: 33827;
45
45
  readonly expectedLocal: 33813;
46
46
  readonly expectedType: 33814;
47
- readonly localDoubleDeclare: 10241;
48
47
  readonly localNotUsed: 10242;
49
48
  readonly localUndeclared: 34817;
50
49
  readonly localShadowing: 34818;
51
- readonly typesNotEqual: 34819;
50
+ readonly localDoubleDeclare: 34819;
51
+ readonly typesNotEqual: 34826;
52
52
  readonly globalNotTyped: 34820;
53
53
  readonly invalidDecart: 34821;
54
54
  readonly invalidBoolean: 34822;
@@ -106,4 +106,4 @@ declare function getRSErrorPrefix(code: RSErrorCode): string;
106
106
  declare function isCritical(code: RSErrorCode): boolean;
107
107
  //#endregion
108
108
  export { RSErrorInfo as a, RSErrorDescription as i, RSErrorClass as n, getRSErrorPrefix as o, RSErrorCode as r, isCritical as s, ErrorReporter as t };
109
- //# sourceMappingURL=error-toW0TUHF.d.ts.map
109
+ //# sourceMappingURL=error-CzIbnP-N.d.ts.map
package/dist/index.d.ts CHANGED
@@ -8,19 +8,19 @@ import { r as printTree, t as CMSyntaxNode } from "./lezer-tree-iS7LpLBJ.js";
8
8
  import { a as TOKEN_ERROR, c as flattenAst, d as printAst, f as visitAstDFS, i as FlatAstNode, l as getNodeIndices, n as AstNodeBase, o as buildTree, r as FlatAST, s as findByUid, t as AstNode, u as getNodeText } from "./ast-C8sIpKdL.js";
9
9
  import { t as Branded } from "./branded-ZlzIcxzu.js";
10
10
  import { n as generateStub, t as applyHash_fnv1a } from "./hash-Y8I4c6Al.js";
11
- import { O as makeTypePath, b as Typification, d as EmptySetT, f as ExpressionType, g as TypeClass, m as LogicT, t as AnyTypificationT, v as TypeID, y as TypePath } from "./typification-Dk-fisgO.js";
12
- import { i as RSErrorDescription, r as RSErrorCode } from "./error-toW0TUHF.js";
13
- import { i as readTypeAnnotation, r as readErrorAnnotation } from "./ast-annotations-CtF7C9uK.js";
11
+ import { b as Typification, d as EmptySetT, f as ExpressionType, g as TypeClass, k as makeTypePath, m as LogicT, t as AnyTypificationT, v as TypeID, y as TypePath } from "./typification-DDuv88ir.js";
12
+ import { i as RSErrorDescription, r as RSErrorCode } from "./error-CzIbnP-N.js";
13
+ import { i as readTypeAnnotation, r as readErrorAnnotation } from "./ast-annotations-CZCzs9Uk.js";
14
14
  import { d as ValuePath, l as Value, o as TUPLE_ID, p as makeValuePath } from "./value-BduA_ZGp.js";
15
- import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "./calculator-REeX2ZS1.js";
16
- import { d as printValue } from "./value-api-B6T6f4Ia.js";
15
+ import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "./calculator-Dt03dsnd.js";
16
+ import { d as printValue } from "./value-api-C2X4Pom5.js";
17
17
  import { t as parser } from "./parser-Bwd8LxJ1.js";
18
18
  import { t as TokenID } from "./token-DeXAmzwr.js";
19
19
  import { t as ValueClass } from "./value-class-CNI-lqXJ.js";
20
- import { a as RSLangAnalyzer, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "./analyzer-QxWs73gP.js";
21
- import { n as ArgumentsType } from "./arguments-extractor-1acwjQNc.js";
22
- import { n as applyAsciiTypeSubstitutions, r as parseTypeText } from "./typification-parser-BBVx1RxP.js";
23
- import { n as TypificationNodeData, t as TypificationGraph } from "./typification-graph-6HcZ-rKH.js";
20
+ import { a as RSLangAnalyzer, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "./analyzer-DqjdciC5.js";
21
+ import { n as ArgumentsType } from "./arguments-extractor-Dd1lFom9.js";
22
+ import { n as applyAsciiTypeSubstitutions, r as parseTypeText } from "./typification-parser-DHO42ZRc.js";
23
+ import { n as TypificationNodeData, t as TypificationGraph } from "./typification-graph-8VdK6_Fh.js";
24
24
  import { ArgumentValue, Attribution, Constituenta, CstClass, CstStatus, CstType, RSForm, RSFormStats, Substitution, TypeInfo } from "./library/rsform.js";
25
25
  import { BasicBinding, BasicsContext, DEFAULT_VALUE_TEXT, EvalStatus, RSModel, RSModelStats } from "./library/rsmodel.js";
26
26
  import { RSEngine } from "./library/rsengine.js";
@@ -1,6 +1,6 @@
1
1
  import { t as AstNode } from "../ast-C8sIpKdL.js";
2
2
  import { l as Value } from "../value-BduA_ZGp.js";
3
- import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../calculator-REeX2ZS1.js";
3
+ import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../calculator-Dt03dsnd.js";
4
4
  import { CstType, RSForm } from "./rsform.js";
5
5
  import { BasicBinding, BasicsContext, EvalStatus, RSModel } from "./rsmodel.js";
6
6
 
@@ -1,7 +1,7 @@
1
1
  import { r as LibraryItem } from "../library-CYun28Xz.js";
2
- import { g as TypeClass, y as TypePath } from "../typification-Dk-fisgO.js";
2
+ import { g as TypeClass, y as TypePath } from "../typification-DDuv88ir.js";
3
3
  import { t as ValueClass } from "../value-class-CNI-lqXJ.js";
4
- import { r as AnalysisFull } from "../analyzer-QxWs73gP.js";
4
+ import { r as AnalysisFull } from "../analyzer-DqjdciC5.js";
5
5
  import { ArgumentValue, Constituenta, CstClass, CstStatus, CstType, RSForm, RSFormStats } from "./rsform.js";
6
6
  import { AliasMapping } from "../rslang/api.js";
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { t as Graph } from "../graph-DR8rL2o3.js";
2
2
  import { i as LibraryItemReference, n as CurrentVersion, r as LibraryItem, s as VersionInfo } from "../library-CYun28Xz.js";
3
- import { f as ExpressionType, y as TypePath } from "../typification-Dk-fisgO.js";
4
- import { a as RSLangAnalyzer, t as AnalysisBase } from "../analyzer-QxWs73gP.js";
3
+ import { f as ExpressionType, y as TypePath } from "../typification-DDuv88ir.js";
4
+ import { a as RSLangAnalyzer, t as AnalysisBase } from "../analyzer-DqjdciC5.js";
5
5
  //#region src/library/rsform.d.ts
6
6
  /** Represents {@link Constituenta} type. */
7
7
  declare const CstType: {
@@ -1,4 +1,4 @@
1
- import { b as Typification, f as ExpressionType } from "../typification-Dk-fisgO.js";
1
+ import { b as Typification, f as ExpressionType } from "../typification-DDuv88ir.js";
2
2
  import { d as ValuePath, l as Value } from "../value-BduA_ZGp.js";
3
3
  import { Constituenta, CstType, RSForm } from "./rsform.js";
4
4
  import { BasicBinding, EvalStatus, RSModelStats } from "./rsmodel.js";
@@ -1,4 +1,4 @@
1
- import { b as Typification, y as TypePath } from "../typification-Dk-fisgO.js";
1
+ import { b as Typification, y as TypePath } from "../typification-DDuv88ir.js";
2
2
  import { Constituenta, RSForm } from "./rsform.js";
3
3
 
4
4
  //#region src/library/structure-planner.d.ts
@@ -1,5 +1,5 @@
1
1
  import { t as AstNode } from "../ast-C8sIpKdL.js";
2
- import { n as ArgumentsType } from "../arguments-extractor-1acwjQNc.js";
2
+ import { n as ArgumentsType } from "../arguments-extractor-Dd1lFom9.js";
3
3
  import { t as generateExpressionFromAst } from "../expression-generator-CoucLIkE.js";
4
4
 
5
5
  //#region src/rslang/api.d.ts
@@ -1,2 +1,2 @@
1
- import { i as readTypeAnnotation, n as annotateType, r as readErrorAnnotation, t as annotateError } from "../ast-annotations-CtF7C9uK.js";
1
+ import { i as readTypeAnnotation, n as annotateType, r as readErrorAnnotation, t as annotateError } from "../ast-annotations-CZCzs9Uk.js";
2
2
  export { annotateError, annotateType, readErrorAnnotation, readTypeAnnotation };
@@ -1,2 +1,2 @@
1
- import { a as RSErrorInfo, i as RSErrorDescription, n as RSErrorClass, o as getRSErrorPrefix, r as RSErrorCode, s as isCritical, t as ErrorReporter } from "../error-toW0TUHF.js";
1
+ import { a as RSErrorInfo, i as RSErrorDescription, n as RSErrorClass, o as getRSErrorPrefix, r as RSErrorCode, s as isCritical, t as ErrorReporter } from "../error-CzIbnP-N.js";
2
2
  export { ErrorReporter, RSErrorClass, RSErrorCode, RSErrorDescription, RSErrorInfo, getRSErrorPrefix, isCritical };
@@ -31,11 +31,11 @@ const RSErrorCode = {
31
31
  expectedArgument: 33827,
32
32
  expectedLocal: 33813,
33
33
  expectedType: 33814,
34
- localDoubleDeclare: 10241,
35
34
  localNotUsed: 10242,
36
35
  localUndeclared: 34817,
37
36
  localShadowing: 34818,
38
- typesNotEqual: 34819,
37
+ localDoubleDeclare: 34819,
38
+ typesNotEqual: 34826,
39
39
  globalNotTyped: 34820,
40
40
  invalidDecart: 34821,
41
41
  invalidBoolean: 34822,
@@ -111,7 +111,8 @@ function getRSErrorPrefix(code) {
111
111
  }
112
112
  /** Checks if error is critical. */
113
113
  function isCritical(code) {
114
- return code !== RSErrorCode.localDoubleDeclare && code !== RSErrorCode.localNotUsed;
114
+ if ((code & 61440) === 8192) return false;
115
+ return true;
115
116
  }
116
117
  //#endregion
117
118
  export { RSErrorClass, RSErrorCode, getRSErrorPrefix, isCritical };
@@ -1 +1 @@
1
- {"version":3,"file":"error.js","names":[],"sources":["../../src/rslang/error.ts"],"sourcesContent":["/** Module: Error types and functions. */\n\n/** Represents error class. */\nexport const RSErrorClass = {\n LEXER: 0,\n PARSER: 1,\n SEMANTIC: 2,\n EVALUATION: 3,\n UNKNOWN: 4\n} as const;\nexport type RSErrorClass = (typeof RSErrorClass)[keyof typeof RSErrorClass];\n\n/** Represents RSLang expression error information. */\nexport interface RSErrorInfo {\n code: RSErrorCode;\n params?: readonly string[];\n}\n\n/** Represents RSLang expression error description. */\nexport interface RSErrorDescription extends RSErrorInfo {\n from: number;\n to: number;\n}\n\n/** Error reporter function type. */\nexport type ErrorReporter = (error: RSErrorDescription) => void;\n\n/** Represents RSLang expression error types. */\nexport const RSErrorCode = {\n unknownSyntax: 0x8400, // 33792\n forbiddenCharacter: 0x8401, // 33793\n bracketMismatch: 0x8409, // 33801\n doubleParenthesis: 0x840a, // 33802\n missingOpenBracket: 0x840b, // 33803\n missingCloseBracket: 0x840c, // 33804\n invalidFilterSyntax: 0x8417, // 33815\n expectedFunctionBody: 0x8418, // 33816\n expectedExpressionBody: 0x8419, // 33817\n expectedLogicBody: 0x841a, // 33818\n expectedQuantifierBody: 0x841b, // 33819\n expectedDeclarativeBody: 0x841c, // 33820\n expectedImperativeBody: 0x841d, // 33821\n expectedRecursiveBody: 0x841e, // 33822\n expectedQuantifierDomain: 0x841f, // 33823\n expectedRightOperand: 0x8420, // 33824\n expectedUnaryOperand: 0x8421, // 33825\n globalFuncParenCall: 0x8422, // 33826\n expectedArgument: 0x8423, // 33827\n expectedLocal: 0x8415, // 33813\n expectedType: 0x8416, // 33814\n\n localDoubleDeclare: 0x2801, // 10241\n localNotUsed: 0x2802, // 10242\n\n localUndeclared: 0x8801, // 34817\n localShadowing: 0x8802, // 34818\n\n typesNotEqual: 0x8803, // 34819\n globalNotTyped: 0x8804, // 34820\n invalidDecart: 0x8805, // 34821\n invalidBoolean: 0x8806, // 34822\n invalidTypeOperation: 0x8807, // 34823\n invalidCard: 0x8808, // 34824\n invalidDebool: 0x8809, // 34825\n globalFuncWithoutArgs: 0x880b, // 34827\n invalidReduce: 0x8810, // 34832\n invalidEnumeration: 0x8813, // 34835\n projectionSetArgumentNotSet: 0x8830, // 34864\n projectionSetArgumentNotTupleSet: 0x8831, // 34865\n projectionSetIndexOutOfRange: 0x8832, // 34866\n projectionTupleArgumentNotTuple: 0x8833, // 34867\n projectionTupleIndexOutOfRange: 0x8834, // 34868\n invalidCortegeDeclare: 0x8814, // 34836\n localOutOfScope: 0x8815, // 34837\n invalidElementPredicate: 0x8816, // 34838\n invalidEmptySetUsage: 0x8817, // 34839\n invalidArgsArity: 0x8818, // 34840\n invalidArgumentType: 0x8819, // 34841\n globalStructure: 0x881c, // 34844\n radicalUsage: 0x8821, // 34849\n invalidFilterArgumentType: 0x8822, // 34850\n invalidFilterArity: 0x8823, // 34851\n arithmeticNotSupported: 0x8824, // 34852\n typesNotCompatible: 0x8825, // 34853\n orderingNotSupported: 0x8826, // 34854\n expectedLogic: 0x8827, // 34855\n expectedSetexpr: 0x8828, // 34856\n invalidArgumentCortegeDeclare: 0x8829, // 34857\n invalidQuantifierDomain: 0x882a, // 34858\n invalidFilterParameterType: 0x882b, // 34859\n invalidFilterIndex: 0x882c, // 34860\n invalidFilterBooleanEchelon: 0x882d, // 34861\n localOutOfScopeParentheses: 0x882e, // 34862\n localUndeclaredInSubexpr: 0x882f, // 34863\n\n globalNoValue: 0x8840, // 34880\n invalidPropertyUsage: 0x8841, // 34881\n\n // Value evaluation (runtime)\n calcUnknownError: 0x8100, // 35328\n setOverflow: 0x8101, // 35329\n booleanBaseLimit: 0x8102, // 35330\n calcGlobalMissing: 0x8103, // 35331\n iterationsLimit: 0x8104, // 35332\n calcInvalidDebool: 0x8105, // 35333\n iterateInfinity: 0x8106, // 35334\n calculationNotSupported: 0x8107, // 35335\n calcInvalidData: 0x8108, // 35336\n\n cstEmptyDerived: 0x8861, // 34913\n definitionNotAllowed: 0x8862 // 34914\n} as const;\nexport type RSErrorCode = (typeof RSErrorCode)[keyof typeof RSErrorCode];\n\nconst ERROR_EVALUATION_MASK = 0x0100;\nconst ERROR_LEXER_MASK = 0x0200;\nconst ERROR_PARSER_MASK = 0x0400;\nconst ERROR_SEMANTIC_MASK = 0x0800;\n\n/** Infers error class from error type (code). */\nfunction inferErrorClass(error: RSErrorCode): RSErrorClass {\n if ((error & ERROR_EVALUATION_MASK) !== 0) {\n return RSErrorClass.EVALUATION;\n } else if ((error & ERROR_LEXER_MASK) !== 0) {\n return RSErrorClass.LEXER;\n } else if ((error & ERROR_PARSER_MASK) !== 0) {\n return RSErrorClass.PARSER;\n } else if ((error & ERROR_SEMANTIC_MASK) !== 0) {\n return RSErrorClass.SEMANTIC;\n } else {\n return RSErrorClass.UNKNOWN;\n }\n}\n\n/** Generate ErrorID label. */\nexport function getRSErrorPrefix(code: RSErrorCode): string {\n const id = code.toString(16).toUpperCase();\n // prettier-ignore\n switch (inferErrorClass(code)) {\n case RSErrorClass.LEXER: return 'L' + id;\n case RSErrorClass.PARSER: return 'P' + id;\n case RSErrorClass.SEMANTIC: return 'S' + id;\n case RSErrorClass.EVALUATION: return 'E' + id;\n case RSErrorClass.UNKNOWN: return 'U' + id;\n }\n}\n\n/** Checks if error is critical. */\nexport function isCritical(code: RSErrorCode): boolean {\n return code !== RSErrorCode.localDoubleDeclare && code !== RSErrorCode.localNotUsed;\n}\n"],"mappings":";;;AAGA,MAAa,eAAe;CAC1B,OAAO;CACP,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,SAAS;AACX;;AAmBA,MAAa,cAAc;CACzB,eAAe;CACf,oBAAoB;CACpB,iBAAiB;CACjB,mBAAmB;CACnB,oBAAoB;CACpB,qBAAqB;CACrB,qBAAqB;CACrB,sBAAsB;CACtB,wBAAwB;CACxB,mBAAmB;CACnB,wBAAwB;CACxB,yBAAyB;CACzB,wBAAwB;CACxB,uBAAuB;CACvB,0BAA0B;CAC1B,sBAAsB;CACtB,sBAAsB;CACtB,qBAAqB;CACrB,kBAAkB;CAClB,eAAe;CACf,cAAc;CAEd,oBAAoB;CACpB,cAAc;CAEd,iBAAiB;CACjB,gBAAgB;CAEhB,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,gBAAgB;CAChB,sBAAsB;CACtB,aAAa;CACb,eAAe;CACf,uBAAuB;CACvB,eAAe;CACf,oBAAoB;CACpB,6BAA6B;CAC7B,kCAAkC;CAClC,8BAA8B;CAC9B,iCAAiC;CACjC,gCAAgC;CAChC,uBAAuB;CACvB,iBAAiB;CACjB,yBAAyB;CACzB,sBAAsB;CACtB,kBAAkB;CAClB,qBAAqB;CACrB,iBAAiB;CACjB,cAAc;CACd,2BAA2B;CAC3B,oBAAoB;CACpB,wBAAwB;CACxB,oBAAoB;CACpB,sBAAsB;CACtB,eAAe;CACf,iBAAiB;CACjB,+BAA+B;CAC/B,yBAAyB;CACzB,4BAA4B;CAC5B,oBAAoB;CACpB,6BAA6B;CAC7B,4BAA4B;CAC5B,0BAA0B;CAE1B,eAAe;CACf,sBAAsB;CAGtB,kBAAkB;CAClB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,mBAAmB;CACnB,iBAAiB;CACjB,yBAAyB;CACzB,iBAAiB;CAEjB,iBAAiB;CACjB,sBAAsB;AACxB;AAGA,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;AACzB,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB;;AAG5B,SAAS,gBAAgB,OAAkC;CACzD,KAAK,QAAQ,2BAA2B,GACtC,OAAO,aAAa;MACf,KAAK,QAAQ,sBAAsB,GACxC,OAAO,aAAa;MACf,KAAK,QAAQ,uBAAuB,GACzC,OAAO,aAAa;MACf,KAAK,QAAQ,yBAAyB,GAC3C,OAAO,aAAa;MAEpB,OAAO,aAAa;AAExB;;AAGA,SAAgB,iBAAiB,MAA2B;CAC1D,MAAM,KAAK,KAAK,SAAS,EAAE,CAAC,CAAC,YAAY;CAEzC,QAAQ,gBAAgB,IAAI,GAA5B;EACE,KAAK,aAAa,OAAO,OAAO,MAAM;EACtC,KAAK,aAAa,QAAQ,OAAO,MAAM;EACvC,KAAK,aAAa,UAAU,OAAO,MAAM;EACzC,KAAK,aAAa,YAAY,OAAO,MAAM;EAC3C,KAAK,aAAa,SAAS,OAAO,MAAM;CAC1C;AACF;;AAGA,SAAgB,WAAW,MAA4B;CACrD,OAAO,SAAS,YAAY,sBAAsB,SAAS,YAAY;AACzE"}
1
+ {"version":3,"file":"error.js","names":[],"sources":["../../src/rslang/error.ts"],"sourcesContent":["/** Module: Error types and functions. */\n\n/** Represents error class. */\nexport const RSErrorClass = {\n LEXER: 0,\n PARSER: 1,\n SEMANTIC: 2,\n EVALUATION: 3,\n UNKNOWN: 4\n} as const;\nexport type RSErrorClass = (typeof RSErrorClass)[keyof typeof RSErrorClass];\n\n/** Represents RSLang expression error information. */\nexport interface RSErrorInfo {\n code: RSErrorCode;\n params?: readonly string[];\n}\n\n/** Represents RSLang expression error description. */\nexport interface RSErrorDescription extends RSErrorInfo {\n from: number;\n to: number;\n}\n\n/** Error reporter function type. */\nexport type ErrorReporter = (error: RSErrorDescription) => void;\n\n/** Represents RSLang expression error types. */\nexport const RSErrorCode = {\n unknownSyntax: 0x8400, // 33792\n forbiddenCharacter: 0x8401, // 33793\n bracketMismatch: 0x8409, // 33801\n doubleParenthesis: 0x840a, // 33802\n missingOpenBracket: 0x840b, // 33803\n missingCloseBracket: 0x840c, // 33804\n invalidFilterSyntax: 0x8417, // 33815\n expectedFunctionBody: 0x8418, // 33816\n expectedExpressionBody: 0x8419, // 33817\n expectedLogicBody: 0x841a, // 33818\n expectedQuantifierBody: 0x841b, // 33819\n expectedDeclarativeBody: 0x841c, // 33820\n expectedImperativeBody: 0x841d, // 33821\n expectedRecursiveBody: 0x841e, // 33822\n expectedQuantifierDomain: 0x841f, // 33823\n expectedRightOperand: 0x8420, // 33824\n expectedUnaryOperand: 0x8421, // 33825\n globalFuncParenCall: 0x8422, // 33826\n expectedArgument: 0x8423, // 33827\n expectedLocal: 0x8415, // 33813\n expectedType: 0x8416, // 33814\n\n localNotUsed: 0x2802, // 10242\n\n localUndeclared: 0x8801, // 34817\n localShadowing: 0x8802, // 34818\n localDoubleDeclare: 0x8803, // 34819\n\n typesNotEqual: 0x880a, // 34826\n globalNotTyped: 0x8804, // 34820\n invalidDecart: 0x8805, // 34821\n invalidBoolean: 0x8806, // 34822\n invalidTypeOperation: 0x8807, // 34823\n invalidCard: 0x8808, // 34824\n invalidDebool: 0x8809, // 34825\n globalFuncWithoutArgs: 0x880b, // 34827\n invalidReduce: 0x8810, // 34832\n invalidEnumeration: 0x8813, // 34835\n projectionSetArgumentNotSet: 0x8830, // 34864\n projectionSetArgumentNotTupleSet: 0x8831, // 34865\n projectionSetIndexOutOfRange: 0x8832, // 34866\n projectionTupleArgumentNotTuple: 0x8833, // 34867\n projectionTupleIndexOutOfRange: 0x8834, // 34868\n invalidCortegeDeclare: 0x8814, // 34836\n localOutOfScope: 0x8815, // 34837\n invalidElementPredicate: 0x8816, // 34838\n invalidEmptySetUsage: 0x8817, // 34839\n invalidArgsArity: 0x8818, // 34840\n invalidArgumentType: 0x8819, // 34841\n globalStructure: 0x881c, // 34844\n radicalUsage: 0x8821, // 34849\n invalidFilterArgumentType: 0x8822, // 34850\n invalidFilterArity: 0x8823, // 34851\n arithmeticNotSupported: 0x8824, // 34852\n typesNotCompatible: 0x8825, // 34853\n orderingNotSupported: 0x8826, // 34854\n expectedLogic: 0x8827, // 34855\n expectedSetexpr: 0x8828, // 34856\n invalidArgumentCortegeDeclare: 0x8829, // 34857\n invalidQuantifierDomain: 0x882a, // 34858\n invalidFilterParameterType: 0x882b, // 34859\n invalidFilterIndex: 0x882c, // 34860\n invalidFilterBooleanEchelon: 0x882d, // 34861\n localOutOfScopeParentheses: 0x882e, // 34862\n localUndeclaredInSubexpr: 0x882f, // 34863\n\n globalNoValue: 0x8840, // 34880\n invalidPropertyUsage: 0x8841, // 34881\n\n // Value evaluation (runtime)\n calcUnknownError: 0x8100, // 35328\n setOverflow: 0x8101, // 35329\n booleanBaseLimit: 0x8102, // 35330\n calcGlobalMissing: 0x8103, // 35331\n iterationsLimit: 0x8104, // 35332\n calcInvalidDebool: 0x8105, // 35333\n iterateInfinity: 0x8106, // 35334\n calculationNotSupported: 0x8107, // 35335\n calcInvalidData: 0x8108, // 35336\n\n cstEmptyDerived: 0x8861, // 34913\n definitionNotAllowed: 0x8862 // 34914\n} as const;\nexport type RSErrorCode = (typeof RSErrorCode)[keyof typeof RSErrorCode];\n\nconst ERROR_EVALUATION_MASK = 0x0100;\nconst ERROR_LEXER_MASK = 0x0200;\nconst ERROR_PARSER_MASK = 0x0400;\nconst ERROR_SEMANTIC_MASK = 0x0800;\n\n/** Infers error class from error type (code). */\nfunction inferErrorClass(error: RSErrorCode): RSErrorClass {\n if ((error & ERROR_EVALUATION_MASK) !== 0) {\n return RSErrorClass.EVALUATION;\n } else if ((error & ERROR_LEXER_MASK) !== 0) {\n return RSErrorClass.LEXER;\n } else if ((error & ERROR_PARSER_MASK) !== 0) {\n return RSErrorClass.PARSER;\n } else if ((error & ERROR_SEMANTIC_MASK) !== 0) {\n return RSErrorClass.SEMANTIC;\n } else {\n return RSErrorClass.UNKNOWN;\n }\n}\n\n/** Generate ErrorID label. */\nexport function getRSErrorPrefix(code: RSErrorCode): string {\n const id = code.toString(16).toUpperCase();\n // prettier-ignore\n switch (inferErrorClass(code)) {\n case RSErrorClass.LEXER: return 'L' + id;\n case RSErrorClass.PARSER: return 'P' + id;\n case RSErrorClass.SEMANTIC: return 'S' + id;\n case RSErrorClass.EVALUATION: return 'E' + id;\n case RSErrorClass.UNKNOWN: return 'U' + id;\n }\n}\n\n/** Checks if error is critical. */\nexport function isCritical(code: RSErrorCode): boolean {\n if ((code & 0xf000) === 0x2000) {\n return false;\n }\n return true;\n}\n"],"mappings":";;;AAGA,MAAa,eAAe;CAC1B,OAAO;CACP,QAAQ;CACR,UAAU;CACV,YAAY;CACZ,SAAS;AACX;;AAmBA,MAAa,cAAc;CACzB,eAAe;CACf,oBAAoB;CACpB,iBAAiB;CACjB,mBAAmB;CACnB,oBAAoB;CACpB,qBAAqB;CACrB,qBAAqB;CACrB,sBAAsB;CACtB,wBAAwB;CACxB,mBAAmB;CACnB,wBAAwB;CACxB,yBAAyB;CACzB,wBAAwB;CACxB,uBAAuB;CACvB,0BAA0B;CAC1B,sBAAsB;CACtB,sBAAsB;CACtB,qBAAqB;CACrB,kBAAkB;CAClB,eAAe;CACf,cAAc;CAEd,cAAc;CAEd,iBAAiB;CACjB,gBAAgB;CAChB,oBAAoB;CAEpB,eAAe;CACf,gBAAgB;CAChB,eAAe;CACf,gBAAgB;CAChB,sBAAsB;CACtB,aAAa;CACb,eAAe;CACf,uBAAuB;CACvB,eAAe;CACf,oBAAoB;CACpB,6BAA6B;CAC7B,kCAAkC;CAClC,8BAA8B;CAC9B,iCAAiC;CACjC,gCAAgC;CAChC,uBAAuB;CACvB,iBAAiB;CACjB,yBAAyB;CACzB,sBAAsB;CACtB,kBAAkB;CAClB,qBAAqB;CACrB,iBAAiB;CACjB,cAAc;CACd,2BAA2B;CAC3B,oBAAoB;CACpB,wBAAwB;CACxB,oBAAoB;CACpB,sBAAsB;CACtB,eAAe;CACf,iBAAiB;CACjB,+BAA+B;CAC/B,yBAAyB;CACzB,4BAA4B;CAC5B,oBAAoB;CACpB,6BAA6B;CAC7B,4BAA4B;CAC5B,0BAA0B;CAE1B,eAAe;CACf,sBAAsB;CAGtB,kBAAkB;CAClB,aAAa;CACb,kBAAkB;CAClB,mBAAmB;CACnB,iBAAiB;CACjB,mBAAmB;CACnB,iBAAiB;CACjB,yBAAyB;CACzB,iBAAiB;CAEjB,iBAAiB;CACjB,sBAAsB;AACxB;AAGA,MAAM,wBAAwB;AAC9B,MAAM,mBAAmB;AACzB,MAAM,oBAAoB;AAC1B,MAAM,sBAAsB;;AAG5B,SAAS,gBAAgB,OAAkC;CACzD,KAAK,QAAQ,2BAA2B,GACtC,OAAO,aAAa;MACf,KAAK,QAAQ,sBAAsB,GACxC,OAAO,aAAa;MACf,KAAK,QAAQ,uBAAuB,GACzC,OAAO,aAAa;MACf,KAAK,QAAQ,yBAAyB,GAC3C,OAAO,aAAa;MAEpB,OAAO,aAAa;AAExB;;AAGA,SAAgB,iBAAiB,MAA2B;CAC1D,MAAM,KAAK,KAAK,SAAS,EAAE,CAAC,CAAC,YAAY;CAEzC,QAAQ,gBAAgB,IAAI,GAA5B;EACE,KAAK,aAAa,OAAO,OAAO,MAAM;EACtC,KAAK,aAAa,QAAQ,OAAO,MAAM;EACvC,KAAK,aAAa,UAAU,OAAO,MAAM;EACzC,KAAK,aAAa,YAAY,OAAO,MAAM;EAC3C,KAAK,aAAa,SAAS,OAAO,MAAM;CAC1C;AACF;;AAGA,SAAgB,WAAW,MAA4B;CACrD,KAAK,OAAO,WAAY,MACtB,OAAO;CAET,OAAO;AACT"}
@@ -1,2 +1,2 @@
1
- import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../../calculator-REeX2ZS1.js";
1
+ import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../../calculator-Dt03dsnd.js";
2
2
  export { CalculatorEvaluateOptions, CalculatorResult, RSCalculator };
@@ -1,5 +1,5 @@
1
1
  import { t as AstNode } from "../../ast-C8sIpKdL.js";
2
- import { t as ErrorReporter } from "../../error-toW0TUHF.js";
2
+ import { t as ErrorReporter } from "../../error-CzIbnP-N.js";
3
3
  import { l as Value, u as ValueContext } from "../../value-BduA_ZGp.js";
4
4
 
5
5
  //#region src/rslang/eval/evaluator.d.ts
@@ -1,2 +1,2 @@
1
- import { _ as setSymDiff, a as extractValue, b as validateValue, c as isTupleValue, d as printValue, f as projection, g as setNestedValue, h as setIntersection, i as convertPathToType, l as makeDefaultValue, m as setDiff, n as cartesianProduct, o as isSetValue, p as reduce, r as contains, s as isSubsetOrEq, t as boolean, u as normalizeValue, v as setUnion, x as valueStub, y as testInvalid } from "../../value-api-B6T6f4Ia.js";
1
+ import { _ as setSymDiff, a as extractValue, b as validateValue, c as isTupleValue, d as printValue, f as projection, g as setNestedValue, h as setIntersection, i as convertPathToType, l as makeDefaultValue, m as setDiff, n as cartesianProduct, o as isSetValue, p as reduce, r as contains, s as isSubsetOrEq, t as boolean, u as normalizeValue, v as setUnion, x as valueStub, y as testInvalid } from "../../value-api-C2X4Pom5.js";
2
2
  export { boolean, cartesianProduct, contains, convertPathToType, extractValue, isSetValue, isSubsetOrEq, isTupleValue, makeDefaultValue, normalizeValue, printValue, projection, reduce, setDiff, setIntersection, setNestedValue, setSymDiff, setUnion, testInvalid, validateValue, valueStub };
@@ -1,14 +1,14 @@
1
- import { O as makeTypePath, b as Typification, d as EmptySetT, f as ExpressionType, g as TypeClass, m as LogicT, t as AnyTypificationT, v as TypeID, y as TypePath } from "../typification-Dk-fisgO.js";
2
- import { i as RSErrorDescription, r as RSErrorCode } from "../error-toW0TUHF.js";
3
- import { i as readTypeAnnotation, r as readErrorAnnotation } from "../ast-annotations-CtF7C9uK.js";
1
+ import { b as Typification, d as EmptySetT, f as ExpressionType, g as TypeClass, k as makeTypePath, m as LogicT, t as AnyTypificationT, v as TypeID, y as TypePath } from "../typification-DDuv88ir.js";
2
+ import { i as RSErrorDescription, r as RSErrorCode } from "../error-CzIbnP-N.js";
3
+ import { i as readTypeAnnotation, r as readErrorAnnotation } from "../ast-annotations-CZCzs9Uk.js";
4
4
  import { d as ValuePath, l as Value, p as makeValuePath } from "../value-BduA_ZGp.js";
5
- import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../calculator-REeX2ZS1.js";
6
- import { d as printValue } from "../value-api-B6T6f4Ia.js";
5
+ import { n as CalculatorResult, r as RSCalculator, t as CalculatorEvaluateOptions } from "../calculator-Dt03dsnd.js";
6
+ import { d as printValue } from "../value-api-C2X4Pom5.js";
7
7
  import { t as parser } from "../parser-Bwd8LxJ1.js";
8
8
  import { t as TokenID } from "../token-DeXAmzwr.js";
9
9
  import { t as ValueClass } from "../value-class-CNI-lqXJ.js";
10
- import { a as RSLangAnalyzer, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "../analyzer-QxWs73gP.js";
11
- import { n as ArgumentsType } from "../arguments-extractor-1acwjQNc.js";
12
- import { n as applyAsciiTypeSubstitutions, r as parseTypeText } from "../typification-parser-BBVx1RxP.js";
13
- import { n as TypificationNodeData, t as TypificationGraph } from "../typification-graph-6HcZ-rKH.js";
10
+ import { a as RSLangAnalyzer, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "../analyzer-DqjdciC5.js";
11
+ import { n as ArgumentsType } from "../arguments-extractor-Dd1lFom9.js";
12
+ import { n as applyAsciiTypeSubstitutions, r as parseTypeText } from "../typification-parser-DHO42ZRc.js";
13
+ import { n as TypificationNodeData, t as TypificationGraph } from "../typification-graph-8VdK6_Fh.js";
14
14
  export { type AnalysisBase, type AnalysisFast, type AnalysisFull, AnyTypificationT, type ArgumentsType, type CalculatorEvaluateOptions, type CalculatorResult, EmptySetT, type ExpressionType, LogicT, RSCalculator, RSErrorCode, type RSErrorDescription, RSLangAnalyzer, TokenID, TypeClass, TypeID, type TypePath, type Typification, TypificationGraph, type TypificationNodeData, type Value, ValueClass, type ValuePath, applyAsciiTypeSubstitutions, makeTypePath, makeValuePath, parseTypeText, printValue, readErrorAnnotation, readTypeAnnotation, parser as rslangParser };
@@ -1,5 +1,5 @@
1
1
  import { n as AstNodeBase } from "../ast-C8sIpKdL.js";
2
- import { f as ExpressionType } from "../typification-Dk-fisgO.js";
2
+ import { f as ExpressionType } from "../typification-DDuv88ir.js";
3
3
  import { t as TokenID } from "../token-DeXAmzwr.js";
4
4
 
5
5
  //#region src/rslang/labels.d.ts
@@ -1,6 +1,6 @@
1
1
  import { t as AstNode } from "../../../ast-C8sIpKdL.js";
2
- import { g as TypeClass } from "../../../typification-Dk-fisgO.js";
3
- import { t as ErrorReporter } from "../../../error-toW0TUHF.js";
2
+ import { g as TypeClass } from "../../../typification-DDuv88ir.js";
3
+ import { t as ErrorReporter } from "../../../error-CzIbnP-N.js";
4
4
 
5
5
  //#region src/rslang/parser/syntax-errors/index.d.ts
6
6
  /** When set, refines incomplete formal headers (`[α∈…]`, quantifiers). */
@@ -1,2 +1,2 @@
1
- import { a as RSLangAnalyzer, i as AnalysisOptions, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "../../analyzer-QxWs73gP.js";
1
+ import { a as RSLangAnalyzer, i as AnalysisOptions, n as AnalysisFast, r as AnalysisFull, t as AnalysisBase } from "../../analyzer-DqjdciC5.js";
2
2
  export { AnalysisBase, AnalysisFast, AnalysisFull, AnalysisOptions, RSLangAnalyzer };
@@ -1,2 +1,2 @@
1
- import { n as ArgumentsType, t as ArgumentsExtractor } from "../../arguments-extractor-1acwjQNc.js";
1
+ import { n as ArgumentsType, t as ArgumentsExtractor } from "../../arguments-extractor-Dd1lFom9.js";
2
2
  export { ArgumentsExtractor, ArgumentsType };
@@ -1,6 +1,6 @@
1
1
  import { t as AstNode } from "../../ast-C8sIpKdL.js";
2
- import { _ as TypeContext, f as ExpressionType } from "../../typification-Dk-fisgO.js";
3
- import { t as ErrorReporter } from "../../error-toW0TUHF.js";
2
+ import { _ as TypeContext, f as ExpressionType } from "../../typification-DDuv88ir.js";
3
+ import { t as ErrorReporter } from "../../error-CzIbnP-N.js";
4
4
 
5
5
  //#region src/rslang/semantic/type-auditor.d.ts
6
6
  /** Type auditor for AST type checking. */
@@ -3,9 +3,9 @@ import { RSErrorCode } from "../error.js";
3
3
  import { getNodeIndices, getNodeText } from "../../parsing/ast.js";
4
4
  import "../../parsing/index.js";
5
5
  import { TokenID } from "../parser/token.js";
6
- import { EmptySetT, IntegerT, LogicT, TypeID, bool, component, debool, isRadical, isTypification, tuple } from "./typification.js";
6
+ import { EmptySetT, IntegerT, LogicT, TypeID, bool, component, debool, isTemplateRadical, isTypification, mangleRadicalId, tuple } from "./typification.js";
7
7
  import { labelRSLangNode, labelToken, labelType } from "../labels.js";
8
- import { checkCompatibility, checkEquality, compareTemplated, hasGenerics, mergeTypifications, substituteBase } from "./typification-api.js";
8
+ import { checkCompatibility, checkEquality, cloneTypification, compareTemplated, hasGenerics, mergeTypifications, substituteBase } from "./typification-api.js";
9
9
  //#region src/rslang/semantic/type-auditor.ts
10
10
  /**
11
11
  * Module: Type auditor for AST type checking.
@@ -607,7 +607,9 @@ var TypeAuditor = class TypeAuditor {
607
607
  if (childType === null) return null;
608
608
  const argType = mangleRadicals(alias, type.args[child - 1].type);
609
609
  if (!compareTemplated(substitutes, argType, childType)) {
610
- this.onError(RSErrorCode.invalidArgumentType, node.children[child], [`${type.args[child - 1].alias}∈${labelType(argType)}`, labelType(childType)]);
610
+ const expectedType = cloneTypification(argType);
611
+ if (substitutes.size > 0) substituteBase(expectedType, substitutes);
612
+ this.onError(RSErrorCode.invalidArgumentType, node.children[child], [`${type.args[child - 1].alias}∈${labelType(expectedType)}`, labelType(childType)]);
611
613
  return null;
612
614
  }
613
615
  }
@@ -620,9 +622,9 @@ function mangleRadicals(funcName, type) {
620
622
  case TypeID.anyTypification:
621
623
  case TypeID.integer: return type;
622
624
  case TypeID.basic:
623
- if (isRadical(type.baseID)) return {
625
+ if (isTemplateRadical(type.baseID)) return {
624
626
  typeID: type.typeID,
625
- baseID: type.baseID + funcName
627
+ baseID: mangleRadicalId(type.baseID, funcName)
626
628
  };
627
629
  return type;
628
630
  case TypeID.collection: return {
@@ -694,8 +696,7 @@ var LocalContext = class {
694
696
  return false;
695
697
  } else {
696
698
  this.onError(RSErrorCode.localDoubleDeclare, node, [alias]);
697
- const index = this.data.indexOf(existing);
698
- if (index !== -1) this.data.splice(index, 1);
699
+ return false;
699
700
  }
700
701
  this.data.push({
701
702
  alias,
@@ -708,17 +709,14 @@ var LocalContext = class {
708
709
  getLocalType(node) {
709
710
  const alias = getNodeText(node);
710
711
  const local = this.data.find((data) => data.alias === alias);
711
- if (local === void 0) {
712
- this.onError(RSErrorCode.localUndeclared, node, [alias]);
713
- return null;
714
- } else if (local.level < 1) {
712
+ if (local === void 0) return this.onError(RSErrorCode.localUndeclared, node, [alias]);
713
+ else if (local.level < 1) {
715
714
  const subexprRoot = findRightLogicOperandRoot(node);
716
715
  if (subexprRoot !== null) {
717
716
  if (pathContainsQuantifier(node, subexprRoot)) return this.onError(RSErrorCode.localUndeclaredInSubexpr, node, [alias, labelType(local.type)]);
718
717
  return this.onError(RSErrorCode.localOutOfScopeParentheses, node, [alias]);
719
718
  }
720
- this.onError(RSErrorCode.localOutOfScope, node, [alias]);
721
- return null;
719
+ return this.onError(RSErrorCode.localOutOfScope, node, [alias]);
722
720
  } else {
723
721
  local.useCount++;
724
722
  return local.type;