feat: include the compiler exe and use working relative filepath
This commit is contained in:
@@ -34,6 +34,7 @@ function deactivate() {
|
|||||||
|
|
||||||
function generateErrors(code) {
|
function generateErrors(code) {
|
||||||
try {
|
try {
|
||||||
|
console.log("generating errors")
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const tmpFilePath = '/tmp/temp_wacc_file.wacc';
|
const tmpFilePath = '/tmp/temp_wacc_file.wacc';
|
||||||
fs.writeFileSync(tmpFilePath, code);
|
fs.writeFileSync(tmpFilePath, code);
|
||||||
@@ -41,8 +42,11 @@ function generateErrors(code) {
|
|||||||
let output;
|
let output;
|
||||||
try {
|
try {
|
||||||
// currently only works if the wacc compiler exe is in the parent directory
|
// currently only works if the wacc compiler exe is in the parent directory
|
||||||
output = execSync(`../wacc_exe ${tmpFilePath}`, { encoding: 'utf8', stdio: 'pipe' });
|
const waccExePath = `${__dirname}/wacc_exe`;
|
||||||
|
output = execSync(`${waccExePath} ${tmpFilePath}`, { encoding: 'utf8', stdio: 'pipe' });
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
console.log("this aint working buddy")
|
||||||
|
console.log(err)
|
||||||
output = err.stdout;
|
output = err.stdout;
|
||||||
}
|
}
|
||||||
let errors = [];
|
let errors = [];
|
||||||
|
|||||||
BIN
wacc-syntax/wacc_exe
Executable file
BIN
wacc-syntax/wacc_exe
Executable file
Binary file not shown.
Reference in New Issue
Block a user