Python 3 interpreter in Go
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

15 lines
273 B

package compiler
type Scope struct {
Instructions []*Instruction
}
func NewScope() *Scope {
return &Scope{
Instructions: make([]*Instruction, 0),
}
}
func (scope *Scope) AddInstruction(instr *Instruction) {
scope.Instructions = append(scope.Instructions, instr)
}