mirror of
https://codeberg.org/scip/tablizer.git
synced 2025-12-19 05:21:03 +01:00
added
This commit is contained in:
21
vendor/github.com/glycerine/zygomys/zygo/address.go
generated
vendored
Normal file
21
vendor/github.com/glycerine/zygomys/zygo/address.go
generated
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
package zygo
|
||||
|
||||
type Address struct {
|
||||
function *SexpFunction
|
||||
position int
|
||||
}
|
||||
|
||||
func (a Address) IsStackElem() {}
|
||||
|
||||
func (stack *Stack) PushAddr(function *SexpFunction, pc int) {
|
||||
stack.Push(Address{function, pc})
|
||||
}
|
||||
|
||||
func (stack *Stack) PopAddr() (*SexpFunction, int, error) {
|
||||
elem, err := stack.Pop()
|
||||
if err != nil {
|
||||
return MissingFunction, 0, err
|
||||
}
|
||||
addr := elem.(Address)
|
||||
return addr.function, addr.position, nil
|
||||
}
|
||||
Reference in New Issue
Block a user