fix wasm
This commit is contained in:
parent
d894e9d460
commit
5919ab23c5
2 changed files with 3 additions and 3 deletions
|
|
@ -8,6 +8,6 @@
|
||||||
<body>
|
<body>
|
||||||
<canvas id="glcanvas" tabindex='1' style="margin: auto; display: block; width: 720px; height: 720px"></canvas>
|
<canvas id="glcanvas" tabindex='1' style="margin: auto; display: block; width: 720px; height: 720px"></canvas>
|
||||||
<script src="./mq_js_bundle.js"></script>
|
<script src="./mq_js_bundle.js"></script>
|
||||||
<script>load("./ayin.wasm");</script>
|
<script>load("./ayin-game.wasm");</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -66,8 +66,8 @@ fn read_file() -> Result<ayin::ast::Program, String> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(target_arch = "wasm32")]
|
#[cfg(target_arch = "wasm32")]
|
||||||
fn read_file() -> Result<ast::Program, String> {
|
fn read_file() -> Result<ayin::ast::Program, String> {
|
||||||
let code = Ok(include_str!("../games/there-she-is.ayin").to_string());
|
let code = include_str!("../games/there-she-is.ayin").to_string();
|
||||||
match ayin::parser::parse_file(code) {
|
match ayin::parser::parse_file(code) {
|
||||||
Err(err) => Err(format!("Error: {err:#?}")),
|
Err(err) => Err(format!("Error: {err:#?}")),
|
||||||
Ok(program) => Ok(program),
|
Ok(program) => Ok(program),
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue