-
Notifications
You must be signed in to change notification settings - Fork 1
/
wat_in_racket.rkt
29 lines (28 loc) · 967 Bytes
/
wat_in_racket.rkt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#lang racket
(require "wat/ast.rkt" "wat/printer.rkt")
(wat-display (Module
(list
(Start 'funcname1)
(Export 'testfunc
(ExportFuncSignature 'funcname1))
(Import 'mod 'func
(FuncSignature
'funcname1
(list
(Param 'firstparam (i64))
(Param 'secondparam (i64)))
(Result (i64))) )
(Func
(FuncSignature
'funcname1
(list
(Param 'firstparam (i64))
(Param 'secondparam (i64)))
(Result (i64)))
(list
(Local 'firstlocal (i64)))
(Body (list
(Inst 'someinstructionwithnoargs '())
(Inst 'i64.neg (list (Const 42)))
(Inst 'i64.add (list (Const 32) (Const 69)))
(Inst 'if (list (Const 1) (Name 'asdf) (Const 5)))))))))