MCPcopy
hub / github.com/expr-lang/expr / Disassemble

Method Disassemble

vm/program.go:76–82  ·  view source on GitHub ↗

Disassemble returns opcodes as a string.

()

Source from the content-addressed store, hash-verified

74
75// Disassemble returns opcodes as a string.
76func (program *Program) Disassemble() string {
77 var buf bytes.Buffer
78 w := tabwriter.NewWriter(&buf, 0, 0, 2, ' ', 0)
79 program.DisassembleWriter(w)
80 _ = w.Flush()
81 return buf.String()
82}
83
84// DisassembleWriter takes a writer and writes opcodes to it.
85func (program *Program) DisassembleWriter(w io.Writer) {

Callers 6

TestPatch_change_identFunction · 0.95
TestProgram_DisassembleFunction · 0.95
mainFunction · 0.95
TestCompileFunction · 0.80
TestBuiltin_with_derefFunction · 0.80

Calls 2

DisassembleWriterMethod · 0.95
StringMethod · 0.65

Tested by 5

TestPatch_change_identFunction · 0.76
TestProgram_DisassembleFunction · 0.76
TestCompileFunction · 0.64
TestBuiltin_with_derefFunction · 0.64