Ejemplo n.º 1
0
        public static LoadScriptExpression Create(
            AphidExpressionContext context_aphidExpressionContext,
            AphidExpression fileExpression_aphidExpression,
            int value_i,
            int value_i1
            )
        {
            LoadScriptExpression loadScriptExpression = new LoadScriptExpression
                                                            (context_aphidExpressionContext, fileExpression_aphidExpression);

            ((AphidExpression)loadScriptExpression).Index  = value_i;
            ((AphidExpression)loadScriptExpression).Length = value_i1;
            return(loadScriptExpression);

            // TODO: Edit factory method of LoadScriptExpression
            // This method should be able to configure the object in all possible ways.
            // Add as many parameters as needed,
            // and assign their values to each field by using the API.
        }
        private AphidObject InterpretLoadScriptExpression(LoadScriptExpression expression)
        {
            var file = ValueHelper.Unwrap(InterpretExpression(expression.FileExpression)) as string;

            if (file == null)
            {
                throw new AphidRuntimeException("Cannot load script {0}", expression.FileExpression);
            }

            _loader.LoadScript(file);

            return null;
        }