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.
|
|
package compiler
|
|
|
|
|
|
import (
|
|
|
"github.com/brettlangdon/gython/bytecode"
|
|
|
"github.com/brettlangdon/gython/gython"
|
|
|
)
|
|
|
|
|
|
type Instruction struct {
|
|
|
Opcode bytecode.Opcode
|
|
|
Oparg *gython.Float
|
|
|
Hasarg bool
|
|
|
Line int
|
|
|
}
|
|
|
|
|
|
func NewInstruction(opcode bytecode.Opcode, oparg *gython.Float, hasarg bool) *Instruction {
|
|
|
return &Instruction{
|
|
|
Opcode: opcode,
|
|
|
Oparg: oparg,
|
|
|
Hasarg: hasarg,
|
|
|
Line: 0,
|
|
|
}
|
|
|
}
|