Versions in this module Expand all Collapse all v0 v0.1.6 May 23, 2022 v0.1.5 Jun 27, 2021 v0.1.4 Jan 6, 2021 v0.1.3 Dec 13, 2019 v0.1.2 Oct 13, 2019 v0.1.1 Sep 13, 2019 v0.1.0 Sep 12, 2019 Changes in this version + func EmitConstant(c *Compiler, k Constant, reg Register, line int) + func EmitMove(c *Compiler, dst Register, src Register, line int) + func EmitMoveNoLine(c *Compiler, dst Register, src Register) + type Bool bool + func (b Bool) Compile(kc *ConstantCompiler) code.Constant + type Call struct + Cont Register + func (c Call) Compile(kc InstrCompiler) + func (c Call) String() string + type ClearReg struct + Dst Register + func (i ClearReg) Compile(kc InstrCompiler) + func (i ClearReg) String() string + type Code struct + Constants []Constant + Instructions []Instruction + LabelPos map[int][]Label + Lines []int + Name string + RegCount int16 + UpNames []string + UpvalueCount int16 + func (c *Code) Compile(kc *ConstantCompiler) code.Constant + type Combine struct + Dst Register + Lsrc Register + Op ops.Op + Rsrc Register + func (c Combine) Compile(kc InstrCompiler) + func (c Combine) String() string + type Compiler struct + func NewCompiler(source string) *Compiler + func (c *Compiler) DeclareGotoLabel(name Name) Label + func (c *Compiler) DeclareLocal(name Name, reg Register) + func (c *Compiler) Dump() + func (c *Compiler) Emit(instr Instruction, line int) + func (c *Compiler) EmitGotoLabel(name Name) + func (c *Compiler) EmitJump(lblName Name, line int) + func (c *Compiler) EmitLabel(lbl Label) + func (c *Compiler) EmitNoLine(instr Instruction) + func (c *Compiler) GetCode(name string) *Code + func (c *Compiler) GetConstant(k Constant) uint + func (c *Compiler) GetFreeRegister() Register + func (c *Compiler) GetGotoLabel(name Name) (Label, bool) + func (c *Compiler) GetNewLabel() Label + func (c *Compiler) GetRegister(name Name) (Register, bool) + func (c *Compiler) NewChild() *Compiler + func (c *Compiler) NewConstantCompiler() *ConstantCompiler + func (c *Compiler) PopContext() + func (c *Compiler) PushContext() + func (c *Compiler) ReleaseRegister(reg Register) + func (c *Compiler) TakeRegister(reg Register) + func (c *Compiler) Upvalues() []Register + type Constant interface + Compile func(*ConstantCompiler) code.Constant + type ConstantCompiler struct + func (kc *ConstantCompiler) CompileQueue() *code.Unit + func (kc *ConstantCompiler) GetConstant(ki uint) Constant + func (kc *ConstantCompiler) QueueConstant(ki uint) int + type ConstantPool struct + func (c *ConstantPool) Constants() []Constant + func (c *ConstantPool) GetConstant(k Constant) uint + type EtcLookup struct + Dst Register + Etc Register + Idx int + func (l EtcLookup) Compile(kc InstrCompiler) + func (l EtcLookup) String() string + type FillTable struct + Dst Register + Etc Register + Idx int + func (f FillTable) Compile(kc InstrCompiler) + func (f FillTable) String() string + type Float float64 + func (f Float) Compile(kc *ConstantCompiler) code.Constant + type InstrCompiler struct + func (ic InstrCompiler) Emit(opcode code.Opcode) + func (ic InstrCompiler) EmitJump(opcode code.Opcode, lbl code.Label) + type Instruction interface + Compile func(InstrCompiler) + type Int int64 + func (n Int) Compile(kc *ConstantCompiler) code.Constant + type Jump struct + Label Label + func (j Jump) Compile(kc InstrCompiler) + func (j Jump) String() string + type JumpIf struct + Cond Register + Label Label + Not bool + func (j JumpIf) Compile(kc InstrCompiler) + func (j JumpIf) String() string + type JumpIfForLoopDone struct + Label Label + Limit Register + Step Register + Var Register + func (j JumpIfForLoopDone) Compile(kc InstrCompiler) + func (j JumpIfForLoopDone) String() string + type Label uint + func (l Label) String() string + type LexicalContext []lexicalMap + func (c LexicalContext) AddLabel(name Name, label Label) (ok bool) + func (c LexicalContext) AddToRoot(name Name, reg Register) (ok bool) + func (c LexicalContext) AddToTop(name Name, reg Register) (ok bool) + func (c LexicalContext) Dump() + func (c LexicalContext) GetLabel(name Name) (label Label, ok bool) + func (c LexicalContext) GetRegister(name Name, tags uint) (reg Register, ok bool) + func (c LexicalContext) Pop() (LexicalContext, lexicalMap) + func (c LexicalContext) PushNew() LexicalContext + func (c LexicalContext) Top() lexicalMap + type LoadConst struct + Dst Register + Kidx uint + func (l LoadConst) Compile(kc InstrCompiler) + func (l LoadConst) String() string + type Lookup struct + Dst Register + Index Register + Table Register + func (s Lookup) Compile(kc InstrCompiler) + func (s Lookup) String() string + type MkClosure struct + Code uint + Dst Register + Upvalues []Register + func (m MkClosure) Compile(kc InstrCompiler) + func (m MkClosure) String() string + type MkCont struct + Closure Register + Dst Register + Tail bool + func (m MkCont) Compile(kc InstrCompiler) + func (m MkCont) String() string + type MkTable struct + Dst Register + func (m MkTable) Compile(kc InstrCompiler) + func (m MkTable) String() string + type Name string + type NilType struct + func (n NilType) Compile(kc *ConstantCompiler) code.Constant + type Push struct + Cont Register + Etc bool + Item Register + func (p Push) Compile(kc InstrCompiler) + func (p Push) String() string + type PushCC struct + Cont Register + func (p PushCC) Compile(kc InstrCompiler) + func (p PushCC) String() string + type Receive struct + Dst []Register + func (r Receive) Compile(kc InstrCompiler) + func (r Receive) String() string + type ReceiveEtc struct + Dst []Register + Etc Register + func (r ReceiveEtc) Compile(kc InstrCompiler) + func (r ReceiveEtc) String() string + type Register int + func (r Register) String() string + type SetIndex struct + Index Register + Src Register + Table Register + func (s SetIndex) Compile(kc InstrCompiler) + func (s SetIndex) String() string + type String string + func (s String) Compile(kc *ConstantCompiler) code.Constant + type Transform struct + Dst Register + Op ops.Op + Src Register + func (t Transform) Compile(kc InstrCompiler) + func (t Transform) String() string