Exemplo n.º 1
0
        public void Add(AbcFile abc)
        {
            foreach (var instance in abc.Instances)
            {
                _instances.Add(instance);

                if (!IsCoreApi)
                {
                    string fullName = instance.FullName;
                    if (fullName == "Object")
                    {
                        abc.IsCore = IsCoreApi = true;
                    }
                }
            }

            foreach (var trait in abc.Scripts.SelectMany(x => x.Traits))
            {
                switch (trait.Kind)
                {
                case AbcTraitKind.Const:
                    var ns = trait.SlotValue as AbcNamespace;
                    if (ns != null)
                    {
                        _namespaces.Add(trait.Name.FullName, abc);
                    }
                    break;

                case AbcTraitKind.Method:
                    _functions.Add(trait);
                    break;
                }
            }
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Sets the value according to the parameter association
        /// </summary>
        /// <param name="association"></param>
        /// <param name="value"></param>
        public void SetValue(Dictionary <Actual, IValue> association, IValue value, ExplanationPart explanation)
        {
            FunctionCache current = Curry;

            foreach (IValue val in OrderedParameters(association))
            {
                FunctionCache next;
                if (!current.TryGetValue(val, out next))
                {
                    next = new FunctionCache();
                    current.Add(val, next);
                }
                current = next;
            }

            current.Value = new ExplainedValue(value, explanation);
        }