This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if len(gobyRoot) == 0 { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmt.Sprintf("/usr/local/Cellar/goby/%s", Version) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
path, _ := filepath.Abs("$GOPATH/src/github.com/goby-lang/goby") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (vm *VM) newThread() *thread { | |
s := &stack{RWMutex: new(sync.RWMutex)} | |
cfs := &callFrameStack{callFrames: []callFrame{}} | |
t := &thread{stack: s, callFrameStack: cfs, sp: 0, cfp: 0} | |
s.thread = t | |
cfs.thread = t | |
t.vm = vm | |
return t | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package classes | |
const ( | |
ObjectClass = "Object" | |
ClassClass = "Class" | |
IntegerClass = "Integer" | |
FloatClass = "Float" | |
StringClass = "String" | |
ArrayClass = "Array" | |
HashClass = "Hash" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func (it *instructionTranslator) transferInstructionSets(sets []*bytecode.InstructionSet) []*instructionSet { | |
iss := []*instructionSet{} | |
for _, set := range sets { | |
it.transferInstructionSet(iss, set) | |
} | |
return iss | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fmt.Errorf("Can't find anchor on action %s", i.Action) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch p := param.(type) { | |
case string: | |
ps = append(ps, p) | |
case *anchor: | |
i.anchor = p | |
case int: | |
ps = append(ps, fmt.Sprint(p)) | |
case bool: | |
ps = append(ps, fmt.Sprint(p)) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type path []byte | |
func (p path) ToUpper() { | |
for i, b := range p { | |
if 'a' <= b && b <= 'z' { | |
p[i] = b + 'A' - 'a' | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slice := make([]int, 10, 15) | |
fmt.Printf("len: %d, cap: %d\n", len(slice), cap(slice)) | |
newSlice := make([]int, len(slice), 2*cap(slice)) | |
for i := range slice { | |
newSlice[i] = slice[i] | |
} | |
slice = newSlice | |
func Extend(slice []int, element int) []int { | |
n := len(slice) |
OlderNewer