Implemented scope into AST