コード例 #1
0
        protected override Completion ExecuteImpl(ExecutionEnvironment enviroment)
        {
            if (String == null)
            {
                return(Completion.Exception(Language.NullException, this));
            }
            var c = String.Execute(enviroment);

            if (!c.IsValue)
            {
                return(c);
            }
            if (!(c.ReturnValue is string))
            {
                return(Completion.Exception(Language.NotStringException, String));
            }

            if (SubString == null)
            {
                return(Completion.Exception(Language.NotStringException, this));
            }
            var f = SubString.Execute(enviroment);

            if (!f.IsValue)
            {
                return(f);
            }
            if (!(f.ReturnValue is string))
            {
                return(Completion.Exception(Language.NotStringException, SubString));
            }
            return(new Completion((c.ReturnValue as string).LastIndexOf(f.ReturnValue as string)));
        }