Compile wat files.

This commit is contained in:
muzam1l
2022-12-07 13:31:59 +05:30
parent 2d836af9ed
commit 911416aa2f
4 changed files with 56 additions and 8 deletions

View File

@@ -150,6 +150,7 @@ const Home: NextPage = () => {
const activeFile = snap.files[snap.active] as IFile | undefined
const activeFileExt = getFileExtention(activeFile?.name)
const canCompile = activeFileExt === 'c' || activeFileExt === 'wat'
return (
<Split
direction="vertical"
@@ -162,7 +163,7 @@ const Home: NextPage = () => {
>
<main style={{ display: 'flex', flex: 1, position: 'relative' }}>
<HooksEditor />
{activeFileExt === 'c' && (
{canCompile && (
<Hotkeys
keyName="command+b,ctrl+b"
onKeyDown={() => !snap.compiling && snap.files.length && compileCode(snap.active)}