Initialize the binder's scope

This commit is contained in:
joeduffy 2017-01-26 17:19:12 -08:00
parent 0e82b3ea06
commit 34e9eec4fb

View file

@ -34,12 +34,14 @@ type SymbolMap map[ast.Definition]symbols.Symbol
// NewContextFrom allocates a fresh binding context linked to the shared context object.
func NewContextFrom(ctx *core.Context) *Context {
return &Context{
bctx := &Context{
Context: ctx,
Types: make(TypeMap),
Tokens: make(TokenMap),
Symbols: make(SymbolMap),
}
NewScope(bctx, true)
return bctx
}
// RequireType requires that a type exists for the given AST expression node.