8000 GitHub - drom/wast-codegen: WebAssembly AST code generator · GitHub
[go: up one dir, main page]

Skip to content

About

WebAssembly AST code generator

Resources

Stars

4 stars

Watchers

1 watching

Forks

Repository files navigation

NPM version Travis appVeyor

WebAssembly code generator

Generates S-expression WebAssembly from (AST)

Use

Node.js

npm i wast-codegen --save
var codegen = require('wast-codegen');

Functions

.generate()

var src = codegen.generate({
  kind: 'binop',
  type: 'i32',
  operator: 'add',
  left: {
    kind: 'get_local',
    id: {
      kind: 'identifier',
      id: 'x'
    }
  },
  right: {
    kind: 'get_local',
    id: {
      kind: 'identifier',
      id: 'y'
    }
  }
});

produces string (i32.add (get_local $x) (get_local $y)

Testing

npm test

License

MIT LICENSE.

About

WebAssembly AST code generator

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0