コード例 #1
0
        public virtual bool LineStats(OMetaStream <char> inputStream, out OMetaList <HostExpression> result, out OMetaStream <char> modifiedStream)
        {
            OMetaList <HostExpression> adds = null;
            OMetaList <HostExpression> subs = null;

            modifiedStream = inputStream;
            if (!MetaRules.Apply(
                    delegate(OMetaStream <char> inputStream2, out OMetaList <HostExpression> result2, out OMetaStream <char> modifiedStream2)
            {
                modifiedStream2 = inputStream2;
                if (!MetaRules.Apply(Number, modifiedStream2, out result2, out modifiedStream2))
                {
                    return(MetaRules.Fail(out result2, out modifiedStream2));
                }
                adds = result2;
                if (!MetaRules.ApplyWithArgs(Exactly, modifiedStream2, out result2, out modifiedStream2, ("\t").AsHostExpressionList()))
                {
                    return(MetaRules.Fail(out result2, out modifiedStream2));
                }
                if (!MetaRules.Apply(Number, modifiedStream2, out result2, out modifiedStream2))
                {
                    return(MetaRules.Fail(out result2, out modifiedStream2));
                }
                subs = result2;
                result2 = (Sugar.Cons(adds, subs)).AsHostExpressionList();
                return(MetaRules.Success());
            }, modifiedStream, out result, out modifiedStream))
            {
                return(MetaRules.Fail(out result, out modifiedStream));
            }
            return(MetaRules.Success());
        }