Ejemplo n.º 1
0
        private void PushDefiniteAssignmentEnvironmentRecord(Node node, string name)
        {
            EnvironmentRecord scope;

            if (!_scope.GlobalEnvironment.TryGetNodeEnvironment(node, out scope))
            {
                // find our parent scope, it may not be just the last entry in _scopes
                // because that can be a StatementScope and we would start a new range.
                var declScope = _scope;

                scope = new DefinitiveAssignmentEnvironmentRecord(node.GetEndIndex(_tree.LocationResolver), name, declScope);

                declScope.Children.Add(scope);
                declScope.GlobalEnvironment.AddNodeEnvironment(node, scope);
                _scope = scope;
            }
        }
        private void PushDefiniteAssignmentEnvironmentRecord(Node node, string name) {
            EnvironmentRecord scope;
            if (!_scope.GlobalEnvironment.TryGetNodeEnvironment(node, out scope)) {
                // find our parent scope, it may not be just the last entry in _scopes
                // because that can be a StatementScope and we would start a new range.
                var declScope = _scope;

                scope = new DefinitiveAssignmentEnvironmentRecord(node.GetEndIndex(_tree.LocationResolver), name, declScope);
                
                declScope.Children.Add(scope);
                declScope.GlobalEnvironment.AddNodeEnvironment(node, scope);
                _scope = scope;
            }
        }