Commit bbdf657c authored by Sean DuBois's avatar Sean DuBois

Fix errors from code review found by kisielk on PR #10 against kisielk/og-rek

parent 1fc6c76e
...@@ -399,15 +399,15 @@ func (d *Decoder) loadBinPersid() error { ...@@ -399,15 +399,15 @@ func (d *Decoder) loadBinPersid() error {
return errNotImplemented return errNotImplemented
} }
type Thunk struct { type Call struct {
Class Class Callable Class
Args []interface{} Args []interface{}
} }
func (d *Decoder) reduce() error { func (d *Decoder) reduce() error {
args := d.pop().([]interface{}) args := d.pop().([]interface{})
class := d.pop().(Class) class := d.pop().(Class)
d.stack = append(d.stack, Thunk{Class: class, Args: args}) d.stack = append(d.stack, Call{Callable: class, Args: args})
return nil return nil
} }
...@@ -536,18 +536,17 @@ func (d *Decoder) build() error { ...@@ -536,18 +536,17 @@ func (d *Decoder) build() error {
} }
type Class struct { type Class struct {
Module, Module, Name string
Name string
} }
func (d *Decoder) global() error { func (d *Decoder) global() error {
module, _, err := d.r.ReadLine() module, _, err := d.r.ReadLine()
if err != nil { if err != nil {
return nil return err
} }
name, _, err := d.r.ReadLine() name, _, err := d.r.ReadLine()
if err != nil { if err != nil {
return nil return err
} }
d.stack = append(d.stack, Class{Module: string(module), Name: string(name)}) d.stack = append(d.stack, Class{Module: string(module), Name: string(name)})
return nil return nil
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment