Пример #1
0
    IResult <TOutput> IParser <TInput, TOutput> .Parse(IParseState <TInput> state)
    {
        EnsureIsNotComplete();
        EnsureRecursionIsPermitted();
        var result = _engine.TryParse(_state, _rbp, _parseControl);

        return(state.Result(this, result));
    }
Пример #2
0
    public IResult <string> Parse(IParseState <char> state)
    {
        Assert.ArgumentNotNull(state, nameof(state));
        var startCp = state.Input.Checkpoint();
        var result  = Engine.GetMatch(state.Input, Regex);

        if (!result.Success)
        {
            startCp.Rewind();
        }
        return(state.Result(this, result));
    }