Пример #1
0
        private VariableDef CreateVariableInDeclaredScope(Lookup name)
        {
            var reference = name.VariableField;

            if (reference != null)
            {
                var declNode  = reference.Scope;
                var declScope = _scope.EnumerateTowardsGlobal.FirstOrDefault(s => s is DeclarativeEnvironmentRecord && ((DeclarativeEnvironmentRecord)s).Node == declNode);
                if (declScope != null)
                {
                    return(declScope.CreateVariable(name, _curUnit, name.Name, false));
                }
            }

            return(_scope.CreateVariable(name, _curUnit, name.Name, false));
        }