From 47f66dfbf369728ad911e3730fff9cbb19e03f50 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Tue, 29 Oct 2019 18:26:04 +0300 Subject: [PATCH] vm: add State() method to get a state description --- pkg/vm/vm.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/vm/vm.go b/pkg/vm/vm.go index 40fe95952..435127399 100644 --- a/pkg/vm/vm.go +++ b/pkg/vm/vm.go @@ -248,6 +248,11 @@ func (v *VM) Stack(n string) string { return buildStackOutput(s) } +// State returns string representation of the state for the VM. +func (v *VM) State() string { + return v.state.String() +} + // Ready returns true if the VM ready to execute the loaded program. // Will return false if no program is loaded. func (v *VM) Ready() bool {