vm: implement Neo.Enumerator.* interops
This commit is contained in:
parent
f92e84c4cf
commit
3ff7fd5262
6 changed files with 204 additions and 4 deletions
|
@ -155,6 +155,17 @@ func (e *Element) Array() []StackItem {
|
|||
}
|
||||
}
|
||||
|
||||
// Interop attempts to get the underlying value of the element
|
||||
// as an interop item.
|
||||
func (e *Element) Interop() *InteropItem {
|
||||
switch t := e.value.(type) {
|
||||
case *InteropItem:
|
||||
return t
|
||||
default:
|
||||
panic("element is not an interop")
|
||||
}
|
||||
}
|
||||
|
||||
// Stack represents a Stack backed by a double linked list.
|
||||
type Stack struct {
|
||||
top Element
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue