|
|
%!s(int64=2) %!d(string=hai) anos | |
|---|---|---|
| .. | ||
| esm | %!s(int64=2) %!d(string=hai) anos | |
| lib | %!s(int64=2) %!d(string=hai) anos | |
| scripts | %!s(int64=2) %!d(string=hai) anos | |
| LICENSE | %!s(int64=2) %!d(string=hai) anos | |
| README.md | %!s(int64=2) %!d(string=hai) anos | |
| package.json | %!s(int64=2) %!d(string=hai) anos | |
AST utils for webassemblyjs
yarn add @webassemblyjs/ast
import { traverse } from "@webassemblyjs/ast";
traverse(ast, {
Module(path) {
console.log(path.node);
}
});
import { signatures } from "@webassemblyjs/ast";
console.log(signatures);
findParent: NodeLocatorreplaceWith: Node => voidremove: () => voidinsertBefore: Node => voidinsertAfter: Node => voidstop: () => voidmodule(id, fields, metadata)moduleMetadata(sections, functionNames, localNames)moduleNameMetadata(value)functionNameMetadata(value, index)localNameMetadata(value, localIndex, functionIndex)binaryModule(id, blob)quoteModule(id, string)sectionMetadata(section, startOffset, size, vectorOfSize)loopInstruction(label, resulttype, instr)instruction(id, args, namedArgs)objectInstruction(id, object, args, namedArgs)ifInstruction(testLabel, test, result, consequent, alternate)stringLiteral(value)numberLiteralFromRaw(value, raw)longNumberLiteral(value, raw)floatLiteral(value, nan, inf, raw)elem(table, offset, funcs)indexInFuncSection(index)valtypeLiteral(name)typeInstruction(id, functype)start(index)globalType(valtype, mutability)leadingComment(value)blockComment(value)data(memoryIndex, offset, init)global(globalType, init, name)table(elementType, limits, name, elements)memory(limits, id)funcImportDescr(id, signature)moduleImport(module, name, descr)moduleExportDescr(exportType, id)moduleExport(name, descr)limit(min, max)signature(params, results)program(body)identifier(value, raw)blockInstruction(label, instr, result)callInstruction(index, instrArgs)callIndirectInstruction(signature, intrs)byteArray(values)func(name, signature, body, isExternal, metadata)isModuleisModuleMetadataisModuleNameMetadataisFunctionNameMetadataisLocalNameMetadataisBinaryModuleisQuoteModuleisSectionMetadataisLoopInstructionisInstructionisObjectInstructionisIfInstructionisStringLiteralisNumberLiteralisLongNumberLiteralisFloatLiteralisElemisIndexInFuncSectionisValtypeLiteralisTypeInstructionisStartisGlobalTypeisLeadingCommentisBlockCommentisDataisGlobalisTableisMemoryisFuncImportDescrisModuleImportisModuleExportDescrisModuleExportisLimitisSignatureisProgramisIdentifierisBlockInstructionisCallInstructionisCallIndirectInstructionisByteArrayisFuncassertModuleassertModuleMetadataassertModuleNameMetadataassertFunctionNameMetadataassertLocalNameMetadataassertBinaryModuleassertQuoteModuleassertSectionMetadataassertLoopInstructionassertInstructionassertObjectInstructionassertIfInstructionassertStringLiteralassertNumberLiteralassertLongNumberLiteralassertFloatLiteralassertElemassertIndexInFuncSectionassertValtypeLiteralassertTypeInstructionassertStartassertGlobalTypeassertLeadingCommentassertBlockCommentassertDataassertGlobalassertTableassertMemoryassertFuncImportDescrassertModuleImportassertModuleExportDescrassertModuleExportassertLimitassertSignatureassertProgramassertIdentifierassertBlockInstructionassertCallInstructionassertCallIndirectInstructionassertByteArrayassertFunc