diff --git a/components/LoadLFortran.js b/components/LoadLFortran.js index 1973529..9ac035e 100644 --- a/components/LoadLFortran.js +++ b/components/LoadLFortran.js @@ -6,36 +6,12 @@ function getLfortranExportedFuncs() { return new Promise((resolve, reject) => { Module.onRuntimeInitialized = function () { resolve({ - emit_ast_from_source: Module.cwrap( - "emit_ast_from_source", - "string", - ["string"] - ), - emit_asr_from_source: Module.cwrap( - "emit_asr_from_source", - "string", - ["string"] - ), - emit_wat_from_source: Module.cwrap( - "emit_wat_from_source", - "string", - ["string"] - ), - emit_cpp_from_source: Module.cwrap( - "emit_cpp_from_source", - "string", - ["string"] - ), - emit_py_from_source: Module.cwrap( - "emit_wat_from_source", - "string", - ["string"] - ), - emit_wasm_from_source: Module.cwrap( - "emit_wasm_from_source", - "string", - ["string"] - ), + emit_ast_from_source: Module.cwrap("emit_ast_from_source", "string", ["string"]), + emit_asr_from_source: Module.cwrap("emit_asr_from_source", "string", ["string"]), + emit_wat_from_source: Module.cwrap("emit_wat_from_source", "string", ["string"]), + emit_cpp_from_source: Module.cwrap("emit_cpp_from_source", "string", ["string"]), + emit_py_from_source: Module.cwrap("emit_wat_from_source", "string", ["string"]), + emit_wasm_from_source: Module.cwrap("emit_wasm_from_source", "string", ["string"]), }); }; }); @@ -126,7 +102,7 @@ async function setup_lfortran_funcs(lfortran_funcs, myPrint) { try { return compiler_funcs.emit_asr_from_source(source_code); } catch (e) { console.log(e); myPrint(e + "\nERROR: ASR could not be generated from the code"); return 0; } } - ; + lfortran_funcs.emit_wat_from_source = function (source_code) { try { return compiler_funcs.emit_wat_from_source(source_code); } catch (e) { console.log(e); myPrint(e + "\nERROR: WAT could not be generated from the code"); return 0; } diff --git a/config/index.js b/config/index.js deleted file mode 100644 index e52f616..0000000 --- a/config/index.js +++ /dev/null @@ -1,7 +0,0 @@ -const dev = process.env.NODE_ENV !== "production"; - -export const myServer = dev - ? "" - : ""; - -// export const imgs = `${server}/imgs`; diff --git a/pages/api/hello.js b/pages/api/hello.js deleted file mode 100644 index df63de8..0000000 --- a/pages/api/hello.js +++ /dev/null @@ -1,5 +0,0 @@ -// Next.js API route support: https://nextjs.org/docs/api-routes/introduction - -export default function handler(req, res) { - res.status(200).json({ name: 'John Doe' }) -}