public override void Execute
        (
            PftContext context
        )
        {
            OnBeforeExecution(context);

            string text = context.Evaluate(Children);

            context.Output.Error.WriteLine(text);

            OnAfterExecution(context);
        }
예제 #2
0
        public override void Execute
        (
            PftContext context
        )
        {
            OnBeforeExecution(context);

            string     argument = context.Evaluate(Children);
            NumberText text     = new NumberText(argument);
            string     result   = text.Increment().ToString();

            context.Write
            (
                this,
                result
            );

            OnAfterExecution(context);
        }
예제 #3
0
        public string[] Execute
        (
            PftContext context
        )
        {
            string text = context.Evaluate(Program);

            if (string.IsNullOrEmpty(text))
            {
                return(new string[0]);
            }
            string[] lines  = text.SplitLines();
            string[] result =
                (
                    from line in lines
                    where !string.IsNullOrEmpty(line)
                    select line.Trim()
                )
                .ToArray();
            return(result);
        }