diff --git a/_state.go b/_state.go index 8b08d1eb..8f0267ef 100644 --- a/_state.go +++ b/_state.go @@ -566,7 +566,7 @@ func (ls *LState) rkValue(idx int) LValue { func (ls *LState) rkString(idx int) string { if (idx & opBitRk) != 0 { - return ls.currentFrame.Fn.Proto.stringConstants[idx & ^opBitRk] + return ls.currentFrame.Fn.Proto.StringConstants[idx & ^opBitRk] } return string(ls.reg.array[ls.currentFrame.LocalBase+idx].(LString)) } diff --git a/_vm.go b/_vm.go index 1d39c87d..84c35a8e 100644 --- a/_vm.go +++ b/_vm.go @@ -248,7 +248,7 @@ func init() { RA := lbase + A Bx := int(inst & 0x3ffff) //GETBX //reg.Set(RA, L.getField(cf.Fn.Env, cf.Fn.Proto.Constants[Bx])) - reg.Set(RA, L.getFieldString(cf.Fn.Env, cf.Fn.Proto.stringConstants[Bx])) + reg.Set(RA, L.getFieldString(cf.Fn.Env, cf.Fn.Proto.StringConstants[Bx])) return 0 }, func(L *LState, inst uint32, baseframe *callFrame) int { //OP_GETTABLE @@ -281,7 +281,7 @@ func init() { RA := lbase + A Bx := int(inst & 0x3ffff) //GETBX //L.setField(cf.Fn.Env, cf.Fn.Proto.Constants[Bx], reg.Get(RA)) - L.setFieldString(cf.Fn.Env, cf.Fn.Proto.stringConstants[Bx], reg.Get(RA)) + L.setFieldString(cf.Fn.Env, cf.Fn.Proto.StringConstants[Bx], reg.Get(RA)) return 0 }, func(L *LState, inst uint32, baseframe *callFrame) int { //OP_SETUPVAL diff --git a/compile.go b/compile.go index d3c665ae..fbf2be8f 100644 --- a/compile.go +++ b/compile.go @@ -359,7 +359,7 @@ type funcContext struct { func newFuncContext(sourcename string, parent *funcContext) *funcContext { fc := &funcContext{ - Proto: newFunctionProto(sourcename), + Proto: NewFunctionProto(sourcename), Code: &codeStore{make([]uint32, 0, 1024), make([]int, 0, 1024), 0}, Parent: parent, Upvalues: newVarNamePool(0), @@ -1158,7 +1158,7 @@ func compileFunctionExpr(context *funcContext, funcexpr *ast.FunctionExpr, ec *e if slv, ok := clv.(LString); ok { sv = string(slv) } - context.Proto.stringConstants = append(context.Proto.stringConstants, sv) + context.Proto.StringConstants = append(context.Proto.StringConstants, sv) } patchCode(context) } // }}} diff --git a/function.go b/function.go index 169e5407..fb74086f 100644 --- a/function.go +++ b/function.go @@ -39,7 +39,7 @@ type FunctionProto struct { DbgCalls []DbgCall DbgUpvalues []string - stringConstants []string + StringConstants []string } /* Upvalue {{{ */ @@ -87,7 +87,7 @@ func UpvalueIndex(i int) int { /* FunctionProto {{{ */ -func newFunctionProto(name string) *FunctionProto { +func NewFunctionProto(name string) *FunctionProto { return &FunctionProto{ SourceName: name, LineDefined: 0, @@ -105,7 +105,7 @@ func newFunctionProto(name string) *FunctionProto { DbgCalls: make([]DbgCall, 0, 128), DbgUpvalues: make([]string, 0, 16), - stringConstants: make([]string, 0, 32), + StringConstants: make([]string, 0, 32), } } diff --git a/state.go b/state.go index ed30a1ba..54cfd283 100644 --- a/state.go +++ b/state.go @@ -570,7 +570,7 @@ func (ls *LState) rkValue(idx int) LValue { func (ls *LState) rkString(idx int) string { if (idx & opBitRk) != 0 { - return ls.currentFrame.Fn.Proto.stringConstants[idx & ^opBitRk] + return ls.currentFrame.Fn.Proto.StringConstants[idx & ^opBitRk] } return string(ls.reg.array[ls.currentFrame.LocalBase+idx].(LString)) } diff --git a/vm.go b/vm.go index a92eb112..54246a98 100644 --- a/vm.go +++ b/vm.go @@ -300,7 +300,7 @@ func init() { RA := lbase + A Bx := int(inst & 0x3ffff) //GETBX //reg.Set(RA, L.getField(cf.Fn.Env, cf.Fn.Proto.Constants[Bx])) - reg.Set(RA, L.getFieldString(cf.Fn.Env, cf.Fn.Proto.stringConstants[Bx])) + reg.Set(RA, L.getFieldString(cf.Fn.Env, cf.Fn.Proto.StringConstants[Bx])) return 0 }, func(L *LState, inst uint32, baseframe *callFrame) int { //OP_GETTABLE @@ -333,7 +333,7 @@ func init() { RA := lbase + A Bx := int(inst & 0x3ffff) //GETBX //L.setField(cf.Fn.Env, cf.Fn.Proto.Constants[Bx], reg.Get(RA)) - L.setFieldString(cf.Fn.Env, cf.Fn.Proto.stringConstants[Bx], reg.Get(RA)) + L.setFieldString(cf.Fn.Env, cf.Fn.Proto.StringConstants[Bx], reg.Get(RA)) return 0 }, func(L *LState, inst uint32, baseframe *callFrame) int { //OP_SETUPVAL