yukigo-ast 0.2.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.mocharc.json +3 -3
- package/CHANGELOG.md +41 -17
- package/dist/globals/expressions.d.ts +27 -25
- package/dist/globals/expressions.d.ts.map +1 -1
- package/dist/globals/expressions.js +47 -10
- package/dist/globals/generics.d.ts +8 -2
- package/dist/globals/generics.d.ts.map +1 -1
- package/dist/globals/generics.js +15 -1
- package/dist/globals/operators.d.ts +13 -69
- package/dist/globals/operators.d.ts.map +1 -1
- package/dist/globals/operators.js +12 -12
- package/dist/globals/patterns.d.ts +24 -25
- package/dist/globals/patterns.d.ts.map +1 -1
- package/dist/globals/patterns.js +66 -12
- package/dist/globals/primitives.d.ts +2 -5
- package/dist/globals/primitives.d.ts.map +1 -1
- package/dist/globals/primitives.js +7 -7
- package/dist/globals/statements.d.ts +28 -194
- package/dist/globals/statements.d.ts.map +1 -1
- package/dist/globals/statements.js +32 -52
- package/dist/globals/testing.d.ts +7 -31
- package/dist/globals/testing.d.ts.map +1 -1
- package/dist/globals/testing.js +6 -6
- package/dist/globals/types.d.ts +13 -35
- package/dist/globals/types.d.ts.map +1 -1
- package/dist/globals/types.js +12 -12
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/paradigms/functional.d.ts +5 -8
- package/dist/paradigms/functional.d.ts.map +1 -1
- package/dist/paradigms/functional.js +4 -4
- package/dist/paradigms/imperative.d.ts +8 -61
- package/dist/paradigms/imperative.d.ts.map +1 -1
- package/dist/paradigms/imperative.js +7 -7
- package/dist/paradigms/logic.d.ts +11 -67
- package/dist/paradigms/logic.d.ts.map +1 -1
- package/dist/paradigms/logic.js +10 -10
- package/dist/paradigms/object.d.ts +19 -105
- package/dist/paradigms/object.d.ts.map +1 -1
- package/dist/paradigms/object.js +24 -15
- package/dist/paradigms/typeclasses.d.ts +3 -51
- package/dist/paradigms/typeclasses.d.ts.map +1 -1
- package/dist/paradigms/typeclasses.js +2 -2
- package/dist/visitor/base.d.ts +4 -2
- package/dist/visitor/base.d.ts.map +1 -1
- package/dist/visitor/expressions.d.ts +34 -31
- package/dist/visitor/expressions.d.ts.map +1 -1
- package/dist/visitor/expressions.js +11 -2
- package/dist/visitor/index.d.ts +160 -164
- package/dist/visitor/index.d.ts.map +1 -1
- package/dist/visitor/operations.d.ts +25 -26
- package/dist/visitor/operations.d.ts.map +1 -1
- package/dist/visitor/operations.js +3 -2
- package/dist/visitor/patterns.d.ts +18 -19
- package/dist/visitor/patterns.d.ts.map +1 -1
- package/dist/visitor/patterns.js +4 -2
- package/dist/visitor/primitives.d.ts +13 -14
- package/dist/visitor/primitives.d.ts.map +1 -1
- package/dist/visitor/primitives.js +3 -2
- package/dist/visitor/statements.d.ts +49 -50
- package/dist/visitor/statements.d.ts.map +1 -1
- package/dist/visitor/statements.js +9 -6
- package/dist/visitor/testing.d.ts +12 -13
- package/dist/visitor/testing.d.ts.map +1 -1
- package/dist/visitor/testing.js +4 -2
- package/dist/visitor/typeclasses.d.ts +8 -9
- package/dist/visitor/typeclasses.d.ts.map +1 -1
- package/dist/visitor/typeclasses.js +4 -2
- package/dist/visitor/types.d.ts +17 -18
- package/dist/visitor/types.d.ts.map +1 -1
- package/dist/visitor/types.js +3 -2
- package/package.json +2 -11
- package/src/globals/expressions.ts +382 -338
- package/src/globals/generics.ts +86 -65
- package/src/globals/operators.ts +517 -517
- package/src/globals/patterns.ts +406 -347
- package/src/globals/primitives.ts +169 -169
- package/src/globals/statements.ts +746 -768
- package/src/globals/testing.ts +131 -131
- package/src/globals/types.ts +372 -375
- package/src/index.ts +13 -14
- package/src/paradigms/functional.ts +129 -128
- package/src/paradigms/imperative.ts +227 -227
- package/src/paradigms/logic.ts +307 -308
- package/src/paradigms/object.ts +362 -356
- package/src/paradigms/typeclasses.ts +96 -95
- package/src/visitor/base.ts +19 -17
- package/src/visitor/expressions.ts +165 -153
- package/src/visitor/index.ts +59 -52
- package/src/visitor/operations.ts +86 -82
- package/src/visitor/patterns.ts +77 -76
- package/src/visitor/primitives.ts +40 -36
- package/src/visitor/statements.ts +264 -261
- package/src/visitor/testing.ts +50 -49
- package/src/visitor/typeclasses.ts +24 -23
- package/src/visitor/types.ts +76 -75
- package/tests/ast.spec.ts +16 -16
- package/tsconfig.json +23 -25
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/globals/runtime.d.ts +0 -64
- package/dist/globals/runtime.d.ts.map +0 -1
- package/dist/globals/runtime.js +0 -32
- package/dist/types.d.ts +0 -4
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -1
- package/src/globals/runtime.ts +0 -132
package/.mocharc.json
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extension": ["ts"],
|
|
3
|
-
"spec": "tests/**/*.spec.ts"
|
|
1
|
+
{
|
|
2
|
+
"extension": ["ts"],
|
|
3
|
+
"spec": "tests/**/*.spec.ts"
|
|
4
4
|
}
|
package/CHANGELOG.md
CHANGED
|
@@ -1,33 +1,57 @@
|
|
|
1
|
-
## 0.2
|
|
1
|
+
## 0.3.2 (2026-08-04)
|
|
2
2
|
|
|
3
3
|
This was a version bump only for yukigo-ast to align it with other projects, there were no code changes.
|
|
4
4
|
|
|
5
|
-
## 0.
|
|
5
|
+
## 0.3.1 (2026-08-01)
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
- **yukigo-ast:** agrego metodo is ASTNode ([6a63873](https://github.com/miyukiproject/yukigo/commit/6a63873))
|
|
10
|
-
|
|
11
|
-
### ❤️ Thank You
|
|
12
|
-
|
|
13
|
-
- Santiago Schneideroff
|
|
7
|
+
This was a version bump only for yukigo-ast to align it with other projects, there were no code changes.
|
|
14
8
|
|
|
15
|
-
## 0.
|
|
9
|
+
## 0.3.0 (2026-08-01)
|
|
16
10
|
|
|
17
11
|
### 🚀 Features
|
|
18
12
|
|
|
19
|
-
-
|
|
20
|
-
- **inspections:** Updated objectInspections ([e9a6483](https://github.com/miyukiproject/yukigo/commit/e9a6483))
|
|
21
|
-
- **yukigo-docs:** Added AST reference & custom inspections guide ([06c8491](https://github.com/miyukiproject/yukigo/commit/06c8491))
|
|
22
|
-
- **yukigo-wollok-parser:** Added support for more nodes. Missing some operations ([847b0c2](https://github.com/miyukiproject/yukigo/commit/847b0c2))
|
|
23
|
-
- **yukigo-wollok-parser:** Initial parser using transformation strategy ([d6a563b](https://github.com/miyukiproject/yukigo/commit/d6a563b))
|
|
24
|
-
- **LogicEngine:** Added LogicEngine with unification algorithm ([57b48a0](https://github.com/miyukiproject/yukigo/commit/57b48a0))
|
|
13
|
+
- Wollok native methods support ([8886fd0](https://github.com/miyukiproject/yukigo/commit/8886fd0))
|
|
25
14
|
|
|
26
15
|
### 🩹 Fixes
|
|
27
16
|
|
|
28
|
-
- **
|
|
17
|
+
- **yukigo-e2e:** fixes to pass E2E tests ([02d895f](https://github.com/miyukiproject/yukigo/commit/02d895f))
|
|
18
|
+
- **yukigo:** replace instanceof with .is method in analyzer ([d953413](https://github.com/miyukiproject/yukigo/commit/d953413))
|
|
19
|
+
- **haskell-parser:** fix bad fallback in DeclarationCollector ([a537aa1](https://github.com/miyukiproject/yukigo/commit/a537aa1))
|
|
29
20
|
|
|
30
21
|
### ❤️ Thank You
|
|
31
22
|
|
|
32
23
|
- noiseArch
|
|
24
|
+
|
|
25
|
+
## 0.2.1 (2026-05-01)
|
|
26
|
+
|
|
27
|
+
This was a version bump only for yukigo-ast to align it with other projects, there were no code changes.
|
|
28
|
+
|
|
29
|
+
## 0.2.0 (2026-04-11)
|
|
30
|
+
|
|
31
|
+
### 🚀 Features
|
|
32
|
+
|
|
33
|
+
- **yukigo-ast:** agrego metodo is ASTNode ([6a63873](https://github.com/miyukiproject/yukigo/commit/6a63873))
|
|
34
|
+
|
|
35
|
+
### ❤️ Thank You
|
|
36
|
+
|
|
37
|
+
- Santiago Schneideroff
|
|
38
|
+
|
|
39
|
+
## 0.1.0 (2025-12-09)
|
|
40
|
+
|
|
41
|
+
### 🚀 Features
|
|
42
|
+
|
|
43
|
+
- **analyzer:** Added missing inspections and tests ([8ffba18](https://github.com/miyukiproject/yukigo/commit/8ffba18))
|
|
44
|
+
- **inspections:** Updated objectInspections ([e9a6483](https://github.com/miyukiproject/yukigo/commit/e9a6483))
|
|
45
|
+
- **yukigo-docs:** Added AST reference & custom inspections guide ([06c8491](https://github.com/miyukiproject/yukigo/commit/06c8491))
|
|
46
|
+
- **yukigo-wollok-parser:** Added support for more nodes. Missing some operations ([847b0c2](https://github.com/miyukiproject/yukigo/commit/847b0c2))
|
|
47
|
+
- **yukigo-wollok-parser:** Initial parser using transformation strategy ([d6a563b](https://github.com/miyukiproject/yukigo/commit/d6a563b))
|
|
48
|
+
- **LogicEngine:** Added LogicEngine with unification algorithm ([57b48a0](https://github.com/miyukiproject/yukigo/commit/57b48a0))
|
|
49
|
+
|
|
50
|
+
### 🩹 Fixes
|
|
51
|
+
|
|
52
|
+
- **interpreter:** Added closures to RuntimeFunction to support Composition reference ([5f16492](https://github.com/miyukiproject/yukigo/commit/5f16492))
|
|
53
|
+
|
|
54
|
+
### ❤️ Thank You
|
|
55
|
+
|
|
56
|
+
- noiseArch
|
|
33
57
|
- Valtolina Matias
|
|
@@ -2,7 +2,7 @@ import { CompositionExpression, Lambda, Application } from "../paradigms/functio
|
|
|
2
2
|
import { Exist, Forall, Findall, Not } from "../paradigms/logic.js";
|
|
3
3
|
import { Self, New, Implement } from "../paradigms/object.js";
|
|
4
4
|
import { Visitor } from "../visitor/index.js";
|
|
5
|
-
import { ASTNode, SourceLocation } from "./generics.js";
|
|
5
|
+
import { ASTNode, SerializeNode, SourceLocation } from "./generics.js";
|
|
6
6
|
import { Operation } from "./operators.js";
|
|
7
7
|
import { SymbolPrimitive, Primitive } from "./primitives.js";
|
|
8
8
|
import { Sequence, Print, For } from "./statements.js";
|
|
@@ -20,7 +20,7 @@ export declare class TupleExpression extends ASTNode {
|
|
|
20
20
|
elements: Expression[];
|
|
21
21
|
constructor(elements: Expression[], loc?: SourceLocation);
|
|
22
22
|
accept<R>(visitor: Visitor<R>): R;
|
|
23
|
-
toJSON():
|
|
23
|
+
toJSON(): SerializeNode;
|
|
24
24
|
}
|
|
25
25
|
/**
|
|
26
26
|
* Fields of a data expression representations
|
|
@@ -33,7 +33,7 @@ export declare class FieldExpression extends ASTNode {
|
|
|
33
33
|
name: SymbolPrimitive;
|
|
34
34
|
constructor(name: SymbolPrimitive, expression: Expression, loc?: SourceLocation);
|
|
35
35
|
accept<R>(visitor: Visitor<R>): R;
|
|
36
|
-
toJSON():
|
|
36
|
+
toJSON(): SerializeNode;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Data expression, used to construct Records
|
|
@@ -48,7 +48,7 @@ export declare class DataExpression extends ASTNode {
|
|
|
48
48
|
name: SymbolPrimitive;
|
|
49
49
|
constructor(name: SymbolPrimitive, contents: FieldExpression[], loc?: SourceLocation);
|
|
50
50
|
accept<R>(visitor: Visitor<R>): R;
|
|
51
|
-
toJSON():
|
|
51
|
+
toJSON(): SerializeNode;
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Cons expression, represent a concatenation of a head and a tail
|
|
@@ -63,7 +63,7 @@ export declare class ConsExpression extends ASTNode {
|
|
|
63
63
|
head: Expression;
|
|
64
64
|
constructor(head: Expression, tail: Expression, loc?: SourceLocation);
|
|
65
65
|
accept<R>(visitor: Visitor<R>): R;
|
|
66
|
-
toJSON():
|
|
66
|
+
toJSON(): SerializeNode;
|
|
67
67
|
}
|
|
68
68
|
/**
|
|
69
69
|
* Represent let...in expressions normally used in Haskell
|
|
@@ -78,11 +78,7 @@ export declare class LetInExpression extends ASTNode {
|
|
|
78
78
|
declarations: Sequence;
|
|
79
79
|
constructor(declarations: Sequence, expression: Expression, loc?: SourceLocation);
|
|
80
80
|
accept<R>(visitor: Visitor<R>): R;
|
|
81
|
-
toJSON():
|
|
82
|
-
type: string;
|
|
83
|
-
declarations: any;
|
|
84
|
-
expression: any;
|
|
85
|
-
};
|
|
81
|
+
toJSON(): SerializeNode;
|
|
86
82
|
}
|
|
87
83
|
/**
|
|
88
84
|
* Otherwise used as the default case in GuardBody
|
|
@@ -94,9 +90,7 @@ export declare class LetInExpression extends ASTNode {
|
|
|
94
90
|
*/
|
|
95
91
|
export declare class Otherwise extends ASTNode {
|
|
96
92
|
accept<R>(visitor: Visitor<R>): R;
|
|
97
|
-
toJSON():
|
|
98
|
-
type: string;
|
|
99
|
-
};
|
|
93
|
+
toJSON(): SerializeNode;
|
|
100
94
|
}
|
|
101
95
|
/**
|
|
102
96
|
* ListComprehension when the for expression is a yield.
|
|
@@ -112,7 +106,7 @@ export declare class ListComprehension extends ASTNode {
|
|
|
112
106
|
projection: Expression;
|
|
113
107
|
constructor(projection: Expression, generators: (Generator | Expression)[], loc?: SourceLocation);
|
|
114
108
|
accept<R>(visitor: Visitor<R>): R;
|
|
115
|
-
toJSON():
|
|
109
|
+
toJSON(): SerializeNode;
|
|
116
110
|
}
|
|
117
111
|
/**
|
|
118
112
|
* Generator represents patterns like "Just m <- ms" or "x <- [1,2,3]"
|
|
@@ -127,7 +121,7 @@ export declare class Generator extends ASTNode {
|
|
|
127
121
|
variable: SymbolPrimitive;
|
|
128
122
|
constructor(variable: SymbolPrimitive, expression: Expression, loc?: SourceLocation);
|
|
129
123
|
accept<R>(visitor: Visitor<R>): R;
|
|
130
|
-
toJSON():
|
|
124
|
+
toJSON(): SerializeNode;
|
|
131
125
|
}
|
|
132
126
|
/**
|
|
133
127
|
* RangeExpression represents when a list is given by comprehension in a defined range
|
|
@@ -150,21 +144,29 @@ export declare class RangeExpression extends ASTNode {
|
|
|
150
144
|
step?: Expression, // for [start, second .. end] syntax
|
|
151
145
|
loc?: SourceLocation);
|
|
152
146
|
accept<R>(visitor: Visitor<R>): R;
|
|
153
|
-
toJSON():
|
|
147
|
+
toJSON(): SerializeNode;
|
|
154
148
|
}
|
|
155
149
|
export declare class NamedArgument extends ASTNode {
|
|
156
150
|
identifier: SymbolPrimitive;
|
|
157
151
|
expression: Expression;
|
|
158
152
|
constructor(identifier: SymbolPrimitive, expression: Expression, loc?: SourceLocation);
|
|
159
153
|
accept<R>(visitor: Visitor<R>): R;
|
|
160
|
-
toJSON():
|
|
161
|
-
type: string;
|
|
162
|
-
identifier: {
|
|
163
|
-
type: import("./primitives.js").YukigoPrimitive;
|
|
164
|
-
value: string;
|
|
165
|
-
};
|
|
166
|
-
expression: any;
|
|
167
|
-
};
|
|
154
|
+
toJSON(): SerializeNode;
|
|
168
155
|
}
|
|
169
|
-
export
|
|
156
|
+
export declare class GuardedExpression extends ASTNode {
|
|
157
|
+
guards: Guard[];
|
|
158
|
+
constructor(guards: Guard[], loc?: SourceLocation);
|
|
159
|
+
accept<R>(visitor: Visitor<R>): R;
|
|
160
|
+
toJSON(): SerializeNode;
|
|
161
|
+
}
|
|
162
|
+
export declare class Guard extends ASTNode {
|
|
163
|
+
/** @hidden */
|
|
164
|
+
body: Expression;
|
|
165
|
+
/** @hidden */
|
|
166
|
+
condition: Expression;
|
|
167
|
+
constructor(condition: Expression, body: Expression, loc?: SourceLocation);
|
|
168
|
+
accept<R>(visitor: Visitor<R>): R;
|
|
169
|
+
toJSON(): SerializeNode;
|
|
170
|
+
}
|
|
171
|
+
export type Expression = Primitive | Operation | TupleExpression | Print | Otherwise | ConsExpression | Self | Sequence | New | Implement | DataExpression | CompositionExpression | Lambda | For | Application | Exist | Forall | Findall | Not | Guard | GuardedExpression | TypeCast | ListComprehension | RangeExpression | Assertion;
|
|
170
172
|
//# sourceMappingURL=expressions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expressions.d.ts","sourceRoot":"","sources":["../../src/globals/expressions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACxF,OAAO,E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,GACL,MAAM,GACN,OAAO,GACP,GAAG,GACH,KAAK,GACL,iBAAiB,GACjB,QAAQ,GACR,iBAAiB,GACjB,eAAe,GACf,SAAS,CAAC"}
|
|
@@ -14,7 +14,7 @@ export class TupleExpression extends ASTNode {
|
|
|
14
14
|
this.elements = elements;
|
|
15
15
|
}
|
|
16
16
|
accept(visitor) {
|
|
17
|
-
return visitor.visitTupleExpr
|
|
17
|
+
return this.dispatchVisit(visitor, visitor.visitTupleExpr);
|
|
18
18
|
}
|
|
19
19
|
toJSON() {
|
|
20
20
|
return {
|
|
@@ -38,7 +38,7 @@ export class FieldExpression extends ASTNode {
|
|
|
38
38
|
this.expression = expression;
|
|
39
39
|
}
|
|
40
40
|
accept(visitor) {
|
|
41
|
-
return visitor.visitFieldExpr
|
|
41
|
+
return this.dispatchVisit(visitor, visitor.visitFieldExpr);
|
|
42
42
|
}
|
|
43
43
|
toJSON() {
|
|
44
44
|
return {
|
|
@@ -65,7 +65,7 @@ export class DataExpression extends ASTNode {
|
|
|
65
65
|
this.contents = contents;
|
|
66
66
|
}
|
|
67
67
|
accept(visitor) {
|
|
68
|
-
return visitor.visitDataExpr
|
|
68
|
+
return this.dispatchVisit(visitor, visitor.visitDataExpr);
|
|
69
69
|
}
|
|
70
70
|
toJSON() {
|
|
71
71
|
return {
|
|
@@ -92,7 +92,7 @@ export class ConsExpression extends ASTNode {
|
|
|
92
92
|
this.tail = tail;
|
|
93
93
|
}
|
|
94
94
|
accept(visitor) {
|
|
95
|
-
return visitor.visitConsExpr
|
|
95
|
+
return this.dispatchVisit(visitor, visitor.visitConsExpr);
|
|
96
96
|
}
|
|
97
97
|
toJSON() {
|
|
98
98
|
return {
|
|
@@ -119,7 +119,7 @@ export class LetInExpression extends ASTNode {
|
|
|
119
119
|
this.expression = expression;
|
|
120
120
|
}
|
|
121
121
|
accept(visitor) {
|
|
122
|
-
return visitor.visitLetInExpr
|
|
122
|
+
return this.dispatchVisit(visitor, visitor.visitLetInExpr);
|
|
123
123
|
}
|
|
124
124
|
toJSON() {
|
|
125
125
|
return {
|
|
@@ -139,7 +139,7 @@ export class LetInExpression extends ASTNode {
|
|
|
139
139
|
*/
|
|
140
140
|
export class Otherwise extends ASTNode {
|
|
141
141
|
accept(visitor) {
|
|
142
|
-
return visitor.visitOtherwise
|
|
142
|
+
return this.dispatchVisit(visitor, visitor.visitOtherwise);
|
|
143
143
|
}
|
|
144
144
|
toJSON() {
|
|
145
145
|
return {
|
|
@@ -165,7 +165,7 @@ export class ListComprehension extends ASTNode {
|
|
|
165
165
|
this.generators = generators;
|
|
166
166
|
}
|
|
167
167
|
accept(visitor) {
|
|
168
|
-
return visitor.visitListComprehension
|
|
168
|
+
return this.dispatchVisit(visitor, visitor.visitListComprehension);
|
|
169
169
|
}
|
|
170
170
|
toJSON() {
|
|
171
171
|
return {
|
|
@@ -192,7 +192,7 @@ export class Generator extends ASTNode {
|
|
|
192
192
|
this.expression = expression;
|
|
193
193
|
}
|
|
194
194
|
accept(visitor) {
|
|
195
|
-
return visitor.visitGenerator
|
|
195
|
+
return this.dispatchVisit(visitor, visitor.visitGenerator);
|
|
196
196
|
}
|
|
197
197
|
toJSON() {
|
|
198
198
|
return {
|
|
@@ -228,7 +228,7 @@ export class RangeExpression extends ASTNode {
|
|
|
228
228
|
this.step = step;
|
|
229
229
|
}
|
|
230
230
|
accept(visitor) {
|
|
231
|
-
return visitor.visitRangeExpression
|
|
231
|
+
return this.dispatchVisit(visitor, visitor.visitRangeExpression);
|
|
232
232
|
}
|
|
233
233
|
toJSON() {
|
|
234
234
|
return {
|
|
@@ -248,7 +248,7 @@ export class NamedArgument extends ASTNode {
|
|
|
248
248
|
this.expression = expression;
|
|
249
249
|
}
|
|
250
250
|
accept(visitor) {
|
|
251
|
-
return visitor.visitNamedArgument
|
|
251
|
+
return this.dispatchVisit(visitor, visitor.visitNamedArgument);
|
|
252
252
|
}
|
|
253
253
|
toJSON() {
|
|
254
254
|
return {
|
|
@@ -258,3 +258,40 @@ export class NamedArgument extends ASTNode {
|
|
|
258
258
|
};
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
|
+
export class GuardedExpression extends ASTNode {
|
|
262
|
+
guards;
|
|
263
|
+
constructor(guards, loc) {
|
|
264
|
+
super(loc);
|
|
265
|
+
this.guards = guards;
|
|
266
|
+
}
|
|
267
|
+
accept(visitor) {
|
|
268
|
+
return this.dispatchVisit(visitor, visitor.visitGuardedExpression);
|
|
269
|
+
}
|
|
270
|
+
toJSON() {
|
|
271
|
+
return {
|
|
272
|
+
type: "GuardedExpression",
|
|
273
|
+
guards: this.guards.map((g) => g.toJSON()),
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
export class Guard extends ASTNode {
|
|
278
|
+
/** @hidden */
|
|
279
|
+
body;
|
|
280
|
+
/** @hidden */
|
|
281
|
+
condition;
|
|
282
|
+
constructor(condition, body, loc) {
|
|
283
|
+
super(loc);
|
|
284
|
+
this.condition = condition;
|
|
285
|
+
this.body = body;
|
|
286
|
+
}
|
|
287
|
+
accept(visitor) {
|
|
288
|
+
return this.dispatchVisit(visitor, visitor.visitGuard);
|
|
289
|
+
}
|
|
290
|
+
toJSON() {
|
|
291
|
+
return {
|
|
292
|
+
type: "Guard",
|
|
293
|
+
condition: this.condition.toJSON(),
|
|
294
|
+
body: this.body.toJSON(),
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
}
|
|
@@ -2,23 +2,29 @@ import { Visitor } from "../visitor/index.js";
|
|
|
2
2
|
import { Expression } from "./expressions.js";
|
|
3
3
|
import { Statement } from "./statements.js";
|
|
4
4
|
type Metadata = Map<string, any>;
|
|
5
|
+
export type SerializeNode = {
|
|
6
|
+
type: string;
|
|
7
|
+
[key: string]: any;
|
|
8
|
+
};
|
|
5
9
|
/**
|
|
6
10
|
* @hidden
|
|
7
11
|
*/
|
|
8
12
|
export declare abstract class ASTNode {
|
|
9
13
|
/** @hidden */
|
|
10
|
-
loc
|
|
14
|
+
loc?: SourceLocation;
|
|
11
15
|
/** @hidden */
|
|
12
16
|
metadata: Metadata;
|
|
13
17
|
constructor(loc?: SourceLocation, metadata?: Metadata);
|
|
14
18
|
setMetadata(key: string, value: any): void;
|
|
15
19
|
getMetadata<T>(key: string): T | undefined;
|
|
16
20
|
hasMetadata(key: string): boolean;
|
|
21
|
+
static [Symbol.hasInstance](instance: any): boolean;
|
|
17
22
|
is<T extends ASTNode>(nodeType: new (...args: any[]) => T): this is T;
|
|
18
23
|
/** @hidden */
|
|
19
24
|
abstract accept<R>(visitor: Visitor<R>): R;
|
|
25
|
+
protected dispatchVisit<R>(visitor: Visitor<R>, callback?: (node: this) => R): R;
|
|
20
26
|
/** @hidden */
|
|
21
|
-
abstract toJSON():
|
|
27
|
+
abstract toJSON(): SerializeNode;
|
|
22
28
|
}
|
|
23
29
|
/**
|
|
24
30
|
* Source location information
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generics.d.ts","sourceRoot":"","sources":["../../src/globals/generics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,KAAK,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEjC;;GAEG;AACH,8BAAsB,OAAO;IAC3B,cAAc;IACP,GAAG,EAAE,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"generics.d.ts","sourceRoot":"","sources":["../../src/globals/generics.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAI5C,KAAK,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,C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AE9B,MAAM,WAAW,YAAY;IAC3B,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,GAAG,CAAC;IAC7B,eAAe,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,UAAU,CAAC;CAC/C"}
|
package/dist/globals/generics.js
CHANGED
|
@@ -19,8 +19,22 @@ export class ASTNode {
|
|
|
19
19
|
hasMetadata(key) {
|
|
20
20
|
return this.metadata.has(key);
|
|
21
21
|
}
|
|
22
|
+
static [Symbol.hasInstance](instance) {
|
|
23
|
+
if (!instance || typeof instance !== "object")
|
|
24
|
+
return false;
|
|
25
|
+
let proto = Object.getPrototypeOf(instance);
|
|
26
|
+
while (proto) {
|
|
27
|
+
if (proto.constructor.name === this.name)
|
|
28
|
+
return true;
|
|
29
|
+
proto = Object.getPrototypeOf(proto);
|
|
30
|
+
}
|
|
31
|
+
return false;
|
|
32
|
+
}
|
|
22
33
|
is(nodeType) {
|
|
23
|
-
return this instanceof nodeType;
|
|
34
|
+
return this instanceof nodeType || this.constructor.name === nodeType.name;
|
|
35
|
+
}
|
|
36
|
+
dispatchVisit(visitor, callback) {
|
|
37
|
+
return callback ? callback.call(visitor, this) : visitor.fallback(this);
|
|
24
38
|
}
|
|
25
39
|
}
|
|
26
40
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Visitor } from "../visitor/index.js";
|
|
2
2
|
import { Expression } from "./expressions.js";
|
|
3
|
-
import { ASTNode, SourceLocation } from "./generics.js";
|
|
3
|
+
import { ASTNode, SerializeNode, SourceLocation } from "./generics.js";
|
|
4
4
|
export type ArithmeticBinaryOperator = "Plus" | "Minus" | "Multiply" | "Divide" | "Modulo" | "Power" | "Max" | "Min";
|
|
5
5
|
export type ArithmeticUnaryOperator = "Round" | "Absolute" | "Ceil" | "Floor" | "Negation" | "Sqrt" | "ToString";
|
|
6
6
|
export type ComparisonOperatorType = "Equal" | "NotEqual" | "Same" | "NotSame" | "Similar" | "NotSimilar" | "GreaterOrEqualThan" | "GreaterThan" | "LessOrEqualThan" | "LessThan";
|
|
@@ -27,11 +27,7 @@ export declare class ArithmeticUnaryOperation extends ASTNode {
|
|
|
27
27
|
operator: ArithmeticUnaryOperator;
|
|
28
28
|
constructor(operator: ArithmeticUnaryOperator, operand: Expression, loc?: SourceLocation);
|
|
29
29
|
accept<R>(visitor: Visitor<R>): R;
|
|
30
|
-
toJSON():
|
|
31
|
-
type: string;
|
|
32
|
-
operator: ArithmeticUnaryOperator;
|
|
33
|
-
operand: Expression;
|
|
34
|
-
};
|
|
30
|
+
toJSON(): SerializeNode;
|
|
35
31
|
}
|
|
36
32
|
/**
|
|
37
33
|
* Represents a binary arithmetic operation like addition or multiplication.
|
|
@@ -46,12 +42,7 @@ export declare class ArithmeticBinaryOperation extends ASTNode {
|
|
|
46
42
|
operator: ArithmeticBinaryOperator;
|
|
47
43
|
constructor(operator: ArithmeticBinaryOperator, left: Expression, right: Expression, loc?: SourceLocation);
|
|
48
44
|
accept<R>(visitor: Visitor<R>): R;
|
|
49
|
-
toJSON():
|
|
50
|
-
type: string;
|
|
51
|
-
operator: ArithmeticBinaryOperator;
|
|
52
|
-
left: Expression;
|
|
53
|
-
right: Expression;
|
|
54
|
-
};
|
|
45
|
+
toJSON(): SerializeNode;
|
|
55
46
|
}
|
|
56
47
|
/**
|
|
57
48
|
* Represents a unary operation on a list, such as getting the head or tail.
|
|
@@ -64,11 +55,7 @@ export declare class ListUnaryOperation extends ASTNode {
|
|
|
64
55
|
operator: ListUnaryOperator;
|
|
65
56
|
constructor(operator: ListUnaryOperator, operand: Expression, loc?: SourceLocation);
|
|
66
57
|
accept<R>(visitor: Visitor<R>): R;
|
|
67
|
-
toJSON():
|
|
68
|
-
type: string;
|
|
69
|
-
operator: ListUnaryOperator;
|
|
70
|
-
operand: Expression;
|
|
71
|
-
};
|
|
58
|
+
toJSON(): SerializeNode;
|
|
72
59
|
}
|
|
73
60
|
/**
|
|
74
61
|
* Represents a binary operation on lists, such as concatenation.
|
|
@@ -83,12 +70,7 @@ export declare class ListBinaryOperation extends ASTNode {
|
|
|
83
70
|
operator: ListBinaryOperator;
|
|
84
71
|
constructor(operator: ListBinaryOperator, left: Expression, right: Expression, loc?: SourceLocation);
|
|
85
72
|
accept<R>(visitor: Visitor<R>): R;
|
|
86
|
-
toJSON():
|
|
87
|
-
type: string;
|
|
88
|
-
operator: ListBinaryOperator;
|
|
89
|
-
left: Expression;
|
|
90
|
-
right: Expression;
|
|
91
|
-
};
|
|
73
|
+
toJSON(): SerializeNode;
|
|
92
74
|
}
|
|
93
75
|
/**
|
|
94
76
|
* Represents a comparison between two values (e.g., >, <, ==).
|
|
@@ -103,12 +85,7 @@ export declare class ComparisonOperation extends ASTNode {
|
|
|
103
85
|
operator: ComparisonOperatorType;
|
|
104
86
|
constructor(operator: ComparisonOperatorType, left: Expression, right: Expression, loc?: SourceLocation);
|
|
105
87
|
accept<R>(visitor: Visitor<R>): R;
|
|
106
|
-
toJSON():
|
|
107
|
-
type: string;
|
|
108
|
-
operator: ComparisonOperatorType;
|
|
109
|
-
left: Expression;
|
|
110
|
-
right: Expression;
|
|
111
|
-
};
|
|
88
|
+
toJSON(): SerializeNode;
|
|
112
89
|
}
|
|
113
90
|
/**
|
|
114
91
|
* Represents a binary logical operation like AND or OR.
|
|
@@ -123,12 +100,7 @@ export declare class LogicalBinaryOperation extends ASTNode {
|
|
|
123
100
|
operator: LogicalBinaryOperator;
|
|
124
101
|
constructor(operator: LogicalBinaryOperator, left: Expression, right: Expression, loc?: SourceLocation);
|
|
125
102
|
accept<R>(visitor: Visitor<R>): R;
|
|
126
|
-
toJSON():
|
|
127
|
-
type: string;
|
|
128
|
-
operator: LogicalBinaryOperator;
|
|
129
|
-
left: Expression;
|
|
130
|
-
right: Expression;
|
|
131
|
-
};
|
|
103
|
+
toJSON(): SerializeNode;
|
|
132
104
|
}
|
|
133
105
|
/**
|
|
134
106
|
* Represents a unary logical operation like NOT.
|
|
@@ -141,11 +113,7 @@ export declare class LogicalUnaryOperation extends ASTNode {
|
|
|
141
113
|
operator: LogicalUnaryOperator;
|
|
142
114
|
constructor(operator: LogicalUnaryOperator, operand: Expression, loc?: SourceLocation);
|
|
143
115
|
accept<R>(visitor: Visitor<R>): R;
|
|
144
|
-
toJSON():
|
|
145
|
-
type: string;
|
|
146
|
-
operator: "Negation";
|
|
147
|
-
operand: Expression;
|
|
148
|
-
};
|
|
116
|
+
toJSON(): SerializeNode;
|
|
149
117
|
}
|
|
150
118
|
/**
|
|
151
119
|
* Represents a binary bitwise operation like AND, OR, XOR.
|
|
@@ -160,12 +128,7 @@ export declare class BitwiseBinaryOperation extends ASTNode {
|
|
|
160
128
|
operator: BitwiseBinaryOperator;
|
|
161
129
|
constructor(operator: BitwiseBinaryOperator, left: Expression, right: Expression, loc?: SourceLocation);
|
|
162
130
|
accept<R>(visitor: Visitor<R>): R;
|
|
163
|
-
toJSON():
|
|
164
|
-
type: string;
|
|
165
|
-
operator: BitwiseBinaryOperator;
|
|
166
|
-
left: Expression;
|
|
167
|
-
right: Expression;
|
|
168
|
-
};
|
|
131
|
+
toJSON(): SerializeNode;
|
|
169
132
|
}
|
|
170
133
|
/**
|
|
171
134
|
* Represents a unary bitwise operation like NOT (complement).
|
|
@@ -178,11 +141,7 @@ export declare class BitwiseUnaryOperation extends ASTNode {
|
|
|
178
141
|
operator: BitwiseUnaryOperator;
|
|
179
142
|
constructor(operator: BitwiseUnaryOperator, operand: Expression, loc?: SourceLocation);
|
|
180
143
|
accept<R>(visitor: Visitor<R>): R;
|
|
181
|
-
toJSON():
|
|
182
|
-
type: string;
|
|
183
|
-
operator: "BitwiseNot";
|
|
184
|
-
operand: Expression;
|
|
185
|
-
};
|
|
144
|
+
toJSON(): SerializeNode;
|
|
186
145
|
}
|
|
187
146
|
/**
|
|
188
147
|
* Represents an operation specific to string manipulation.
|
|
@@ -197,12 +156,7 @@ export declare class StringOperation extends ASTNode {
|
|
|
197
156
|
operator: StringBinaryOperator;
|
|
198
157
|
constructor(operator: StringBinaryOperator, left: Expression, right: Expression, loc?: SourceLocation);
|
|
199
158
|
accept<R>(visitor: Visitor<R>): R;
|
|
200
|
-
toJSON():
|
|
201
|
-
type: string;
|
|
202
|
-
operator: "Concat";
|
|
203
|
-
left: Expression;
|
|
204
|
-
right: Expression;
|
|
205
|
-
};
|
|
159
|
+
toJSON(): SerializeNode;
|
|
206
160
|
}
|
|
207
161
|
/**
|
|
208
162
|
* Represents a unification operation (=), fundamental to logic programming.
|
|
@@ -220,12 +174,7 @@ export declare class UnifyOperation extends ASTNode {
|
|
|
220
174
|
operator: UnifyOperator;
|
|
221
175
|
constructor(operator: UnifyOperator, left: Expression, right: Expression, loc?: SourceLocation);
|
|
222
176
|
accept<R>(visitor: Visitor<R>): R;
|
|
223
|
-
toJSON():
|
|
224
|
-
type: string;
|
|
225
|
-
operator: "Unify";
|
|
226
|
-
left: Expression;
|
|
227
|
-
right: Expression;
|
|
228
|
-
};
|
|
177
|
+
toJSON(): SerializeNode;
|
|
229
178
|
}
|
|
230
179
|
/**
|
|
231
180
|
* Represents an in-place assignment operation (e.g., +=, -=).
|
|
@@ -240,12 +189,7 @@ export declare class AssignOperation extends ASTNode {
|
|
|
240
189
|
operator: AssignOperator;
|
|
241
190
|
constructor(operator: AssignOperator, left: Expression, right: Expression, loc?: SourceLocation);
|
|
242
191
|
accept<R>(visitor: Visitor<R>): R;
|
|
243
|
-
toJSON():
|
|
244
|
-
type: string;
|
|
245
|
-
operator: "Assign";
|
|
246
|
-
left: Expression;
|
|
247
|
-
right: Expression;
|
|
248
|
-
};
|
|
192
|
+
toJSON(): SerializeNode;
|
|
249
193
|
}
|
|
250
194
|
export type BinaryOperation = ArithmeticBinaryOperation | StringOperation | ListBinaryOperation | LogicalBinaryOperation | ComparisonOperation | UnifyOperation | AssignOperation | BitwiseBinaryOperation;
|
|
251
195
|
export type UnaryOperation = ArithmeticUnaryOperation | ListUnaryOperation | LogicalUnaryOperation | BitwiseUnaryOperation;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../src/globals/operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"operators.d.ts","sourceRoot":"","sources":["../../src/globals/operators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEvE,MAAM,MAAM,wBAAwB,GAChC,MAAM,GACN,OAAO,GACP,UAAU,GACV,QAAQ,GACR,QAAQ,GACR,OAAO,GACP,KAAK,GACL,KAAK,CAAC;AACV,MAAM,MAAM,uBAAuB,GAC/B,OAAO,GACP,UAAU,GACV,MAAM,GACN,OAAO,GACP,UAAU,GACV,MAAM,GACN,UAAU,CAAC;AAEf,MAAM,MAAM,sBAAsB,GAC9B,OAAO,GACP,UAAU,GACV,MAAM,GACN,SAAS,GACT,SAAS,GACT,YAAY,GACZ,oBAAoB,GACpB,aAAa,GACb,iBAAiB,GACjB,UAAU,CAAC;AAEf,MAAM,MAAM,qBAAqB,GAAG,KAAK,GAAG,IAAI,CAAC;AACjD,MAAM,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAE9C,MAAM,MAAM,qBAAqB,GAC7B,WAAW,GACX,YAAY,GACZ,kBAAkB,GAClB,mBAAmB,GACnB,2BAA2B,GAC3B,YAAY,CAAC;AAEjB,MAAM,MAAM,oBAAoB,GAAG,YAAY,CAAC;AAEhD,MAAM,MAAM,kBAAkB,GAC1B,MAAM,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