greybel-interpreter 1.7.4 → 1.7.5
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/dist/cps.js +7 -7
- package/package.json +1 -1
package/dist/cps.js
CHANGED
|
@@ -83,12 +83,12 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
|
|
|
83
83
|
const importExpr = item;
|
|
84
84
|
const target = yield context.handler.resourceHandler.getTargetRelativeTo(currentTarget, importExpr.path);
|
|
85
85
|
if (stack.includes(target)) {
|
|
86
|
-
console.warn(
|
|
86
|
+
console.warn(`Found circluar dependency between "${currentTarget}" and "${target}" at line ${item.start.line}. Using noop instead to prevent overflow.`);
|
|
87
87
|
return new noop_1.Noop(item, target);
|
|
88
88
|
}
|
|
89
89
|
const code = yield context.handler.resourceHandler.get(target);
|
|
90
90
|
if (code == null) {
|
|
91
|
-
throw new error_1.PrepareError(`Cannot find import ${currentTarget}.`, {
|
|
91
|
+
throw new error_1.PrepareError(`Cannot find import "${currentTarget}" at line ${item.start.line}.`, {
|
|
92
92
|
target: currentTarget,
|
|
93
93
|
item
|
|
94
94
|
});
|
|
@@ -112,12 +112,12 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
|
|
|
112
112
|
const includeExpr = item;
|
|
113
113
|
const target = yield context.handler.resourceHandler.getTargetRelativeTo(currentTarget, includeExpr.path);
|
|
114
114
|
if (stack.includes(target)) {
|
|
115
|
-
console.warn(
|
|
115
|
+
console.warn(`Found circluar dependency between "${currentTarget}" and "${target}" at line ${item.start.line}. Using noop instead to prevent overflow.`);
|
|
116
116
|
return new noop_1.Noop(item, target);
|
|
117
117
|
}
|
|
118
118
|
const code = yield context.handler.resourceHandler.get(target);
|
|
119
119
|
if (code == null) {
|
|
120
|
-
throw new error_1.PrepareError(`Cannot find include ${currentTarget}.`, {
|
|
120
|
+
throw new error_1.PrepareError(`Cannot find include "${currentTarget}" at line ${item.start.line}.`, {
|
|
121
121
|
target: currentTarget,
|
|
122
122
|
item
|
|
123
123
|
});
|
|
@@ -140,17 +140,17 @@ const visit = (context, stack, item) => __awaiter(void 0, void 0, void 0, functi
|
|
|
140
140
|
case greyscript_core_1.ASTType.ImportCodeExpression: {
|
|
141
141
|
const importExpr = item;
|
|
142
142
|
if (importExpr.fileSystemDirectory === null) {
|
|
143
|
-
console.warn(`Ignoring dependency in ${currentTarget}. Using noop operation.`);
|
|
143
|
+
console.warn(`Ignoring dependency "${importExpr.gameDirectory}" in "${currentTarget}" at line "${item.start.line}" due to missing file system path. Using noop operation.`);
|
|
144
144
|
return new noop_1.Noop(item, currentTarget);
|
|
145
145
|
}
|
|
146
146
|
const target = yield context.handler.resourceHandler.getTargetRelativeTo(currentTarget, importExpr.fileSystemDirectory);
|
|
147
147
|
if (stack.includes(target)) {
|
|
148
|
-
console.warn(`Found circluar dependency
|
|
148
|
+
console.warn(`Found circluar dependency between "${currentTarget}" and "${target}" at line ${item.start.line}. Using noop instead to prevent overflow.`);
|
|
149
149
|
return new noop_1.Noop(item, target);
|
|
150
150
|
}
|
|
151
151
|
const code = yield context.handler.resourceHandler.get(target);
|
|
152
152
|
if (code == null) {
|
|
153
|
-
throw new error_1.PrepareError(`Cannot find native import ${currentTarget}.`, {
|
|
153
|
+
throw new error_1.PrepareError(`Cannot find native import "${currentTarget}" at line ${item.start.line}.`, {
|
|
154
154
|
target: currentTarget,
|
|
155
155
|
item
|
|
156
156
|
});
|