Skip to content

Commit

Permalink
docs updated
Browse files Browse the repository at this point in the history
  • Loading branch information
nyzd committed Feb 9, 2024
1 parent 428589a commit 2cb1f8d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions docs/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const FIG_MONACO_CONFIG = {
'fn', 'break', 'return', 'let', 'else', 'external', 'builtin', 'export', 'if', 'loop', 'const'],

typeKeywords: [
'i32', 'i64', 'string', 'bool'
'i32', 'i64', 'char', 'bool'
],

parenFollows: [
Expand Down Expand Up @@ -186,13 +186,16 @@ const FIG_MONACO_CONFIG = {
},
};

const PRELUDE = `external console { fn log(n: i32); fn log_str(s: string); }
const MAIN_EXAMPLE = `external console {
fn log(n: i32);
fn log_str(s: char[]);
}
builtin fn malloc(size: i32): i32;
builtin fn free(size: i32): i32;
`;
const MAIN_EXAMPLE = `export fn main() {
let x: string = "Hello World";
export fn main() {
let x: char[] = "Hello World";
log_str(x);
}
`;
Expand Down Expand Up @@ -333,7 +336,7 @@ function string_from_chars(chars) {
DOM.compile_btn.addEventListener("click", async () => {
DOM.console.innerHTML = "";
try {
const source = PRELUDE + editor.getValue();
const source = editor.getValue();
const result = wasm_main(source, memory_offset);
const mod = wabt.readWasm(result, { readDebugNames: true });

Expand Down
Binary file modified docs/pkg/figc_bg.wasm
Binary file not shown.

0 comments on commit 2cb1f8d

Please sign in to comment.