internal sealed override bool TryParse(ref ParseState <TToken> state, ref ExpectedCollector <TToken> expecteds, out Unit result) { if (state.HasCurrent) { state.Error = new InternalError <TToken>( Maybe.Just(state.Current), false, state.Location, null ); expecteds.Add(new Expected <TToken>()); result = default; return(false); } result = Unit.Value; return(true); }
internal sealed override bool TryParse(ref ParseState <TToken> state, ref ExpectedCollector <TToken> expecteds, out int result) { result = state.Location; return(true); }
internal override bool TryParse(ref ParseState <TToken> state, ref ExpectedCollector <TToken> expecteds, out T result) { throw new NotImplementedException(); }
internal sealed override bool TryParse(ref ParseState <TToken> state, ref ExpectedCollector <TToken> expecteds, out SourcePos result) { result = state.ComputeSourcePos(); return(true); }
internal sealed override bool TryParse(ref ParseState <TToken> state, ref ExpectedCollector <TToken> expecteds, out T result) { result = _value; return(true); }