You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: scripts.go
    path of file: ./repos/erda/pkg/database/sqlparser/migrator
    
    the code of the file until where you have to start completion: // Copyright (c) 2021 Terminus, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/L
    
func (r *referencer) Enter(in ast.Node) (out ast.Node, skipChildren bool) {
	switch stmt := in.(type) {
	case *ast.CreateTableStmt:
		r.tableNames[stmt.Table.Name.String()] = true
		return in, true
	case *ast.AlterTableStmt:
		for _, spec := range stmt.Specs {
			if spec.Tp == ast.AlterTableRenameTable && spec.NewTable != nil && spec.NewTable.Name.String() != "" {
				r.tableNames[spec.NewTable.Name.String()] = true
			}
		}
		return in, false
	case *ast.TableName:
		// if the referenced table name is not in the tableNames, error happened
		if _, ok := r.tableNames[stmt.Name.String()]; !ok {
			r.err = errors.Errorf("the table you referenced dose not exist, may it not created in this module directory")
		}
		return in, true
	default:
		return in, false
	}
}