Skip to content

Instantly share code, notes, and snippets.

Avatar

Chris Lavoie christianlavoie

View GitHub Profile
View Main.hs
{-# LANGUAGE ScopedTypeVariables #-}
module Main (runParser, main) where
import Asterius.Text
import Asterius.Types
import Control.Concurrent (threadDelay)
import Data.Text (Text)
import Data.Void (Void)
View Main.mjs
import * as rts from "./_build/rts.mjs";
import module from "./_build/Main.wasm.mjs";
import req from "./_build/Main.req.mjs";
module.then(m =>
rts.newAsteriusInstance(Object.assign(req, {module: m})))
.then(i => {
i.exports.main()
.catch(err => {
if (!(err.startsWith('ExitSuccess') || err.startsWith('ExitFailure ')))