root 3bf41bf355 update | há 1 ano atrás | |
---|---|---|
.. | ||
esm | há 1 ano atrás | |
lib | há 1 ano atrás | |
scripts | há 1 ano atrás | |
LICENSE | há 1 ano atrás | |
README.md | há 1 ano atrás | |
package.json | há 1 ano atrás |
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: NodeLocator
replaceWith: Node => void
remove: () => void
insertBefore: Node => void
insertAfter: Node => void
stop: () => void
module(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)
isModule
isModuleMetadata
isModuleNameMetadata
isFunctionNameMetadata
isLocalNameMetadata
isBinaryModule
isQuoteModule
isSectionMetadata
isLoopInstruction
isInstruction
isObjectInstruction
isIfInstruction
isStringLiteral
isNumberLiteral
isLongNumberLiteral
isFloatLiteral
isElem
isIndexInFuncSection
isValtypeLiteral
isTypeInstruction
isStart
isGlobalType
isLeadingComment
isBlockComment
isData
isGlobal
isTable
isMemory
isFuncImportDescr
isModuleImport
isModuleExportDescr
isModuleExport
isLimit
isSignature
isProgram
isIdentifier
isBlockInstruction
isCallInstruction
isCallIndirectInstruction
isByteArray
isFunc
assertModule
assertModuleMetadata
assertModuleNameMetadata
assertFunctionNameMetadata
assertLocalNameMetadata
assertBinaryModule
assertQuoteModule
assertSectionMetadata
assertLoopInstruction
assertInstruction
assertObjectInstruction
assertIfInstruction
assertStringLiteral
assertNumberLiteral
assertLongNumberLiteral
assertFloatLiteral
assertElem
assertIndexInFuncSection
assertValtypeLiteral
assertTypeInstruction
assertStart
assertGlobalType
assertLeadingComment
assertBlockComment
assertData
assertGlobal
assertTable
assertMemory
assertFuncImportDescr
assertModuleImport
assertModuleExportDescr
assertModuleExport
assertLimit
assertSignature
assertProgram
assertIdentifier
assertBlockInstruction
assertCallInstruction
assertCallIndirectInstruction
assertByteArray
assertFunc