@harmoniclabs/pebble 0.1.0-dev3 → 0.1.0-dev4
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.
|
@@ -91,9 +91,19 @@ export class AstCompiler extends DiagnosticEmitter {
|
|
|
91
91
|
this.error(DiagnosticCode.File_0_not_found, undefined, this.cfg.entry);
|
|
92
92
|
throw new Error("entry file not found");
|
|
93
93
|
}
|
|
94
|
+
if (!this.io.exsistSync(filePath))
|
|
95
|
+
throw new Error("AstCompiler.compile: entry file does not exist: " + filePath);
|
|
94
96
|
const entrySrc = await this.compileFile(filePath, true);
|
|
95
|
-
if (this.diagnostics.length > 0 || !entrySrc)
|
|
96
|
-
|
|
97
|
+
if (this.diagnostics.length > 0 || !entrySrc) {
|
|
98
|
+
let msg;
|
|
99
|
+
globalThis.console && console.log(this.diagnostics);
|
|
100
|
+
const fstErrorMsg = this.diagnostics[0].toString();
|
|
101
|
+
const nDiags = this.diagnostics.length;
|
|
102
|
+
while (msg = this.diagnostics.shift()) {
|
|
103
|
+
this.io.stdout.write(msg.toString() + "\n");
|
|
104
|
+
}
|
|
105
|
+
throw new Error("AstCompiler.compile: failed with " + nDiags + " diagnostic messages; first message: " + fstErrorMsg);
|
|
106
|
+
}
|
|
97
107
|
const mainFuncExpr = this.program.functions.get(this.program.contractTirFuncName);
|
|
98
108
|
if (this.program.contractTirFuncName === "" || !mainFuncExpr) {
|
|
99
109
|
this.error(DiagnosticCode.Main_function_is_missing, undefined);
|
package/package.json
CHANGED