コード例 #1
0
        public override void ResolveReferences(IReferenceResolver referenceResolver)
        {
            var leftFunction = (ReferenceFunction)_leftFunction;

            _leftFunction = referenceResolver.Resolve(leftFunction.GetName());
            var rightFunction = (ReferenceFunction)_rightFunction;

            _rightFunction = referenceResolver.Resolve(rightFunction.GetName());
        }
コード例 #2
0
        public IScript LoadModule(string absoluteReference, string fromModule)
        {
            var logger = LogManager.GetCurrentClassLogger();

            var fileInfo = _referenceResolver.Resolve(fromModule, absoluteReference);

            if (fileInfo.Exists == false)
            {
                logger.Error($"Referenced file does not exist: {absoluteReference} -> {fileInfo}");

                return(null);
            }

            return(TryLoad(fileInfo));
        }
コード例 #3
0
        public void Visit(MethodCallValue operand)
        {
            operand.Parent().Accept(this);
            object     receiver = _value;
            MethodInfo method   = _resolver.Resolve(operand.Method);

            try
            {
                _value = method.Invoke(IsStatic(method) ? null : receiver, Args(operand));
            }
            catch (Exception exc)
            {
                Sharpen.Runtime.PrintStackTrace(exc);
                _value = null;
            }
        }
コード例 #4
0
        private dynamic Require(string fromModule, string moduleName)
        {
            var definition = _packageSystem.GetDefinition(fromModule, moduleName);

            if (definition == null)
            {
                LoadScript(_referenceResolver.Resolve(fromModule, moduleName));

                definition = _packageSystem.GetDefinition(fromModule, moduleName);
            }

            if (definition != null)
            {
                return(definition());
            }

            return(null);
        }
コード例 #5
0
        public override void ResolveReferences(IReferenceResolver referenceResolver)
        {
            var function = (ReferenceFunction)_function;

            _function = referenceResolver.Resolve(function.GetName());
        }