Beispiel #1
0
func New() *Runtime {
	r := &Runtime{
		stack:      util.NewStack(),
		curScope:   scope.New(),
		scopeStack: util.NewStack(),
	}

	for n, f := range builtins {
		r.curScope.SetFunc(n, scope.Entry{Value: f, DataType: types.BUILTIN})
	}
	return r
}
Beispiel #2
0
func New(s *scanner.Scanner) *Parser {
	p := &Parser{scanner: s, scope: scope.New()}
	p.advance()
	return p
}