示例#1
0
 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);
 }
示例#2
0
 internal sealed override bool TryParse(ref ParseState <TToken> state, ref ExpectedCollector <TToken> expecteds, out int result)
 {
     result = state.Location;
     return(true);
 }
示例#3
0
 internal override bool TryParse(ref ParseState <TToken> state, ref ExpectedCollector <TToken> expecteds, out T result)
 {
     throw new NotImplementedException();
 }
示例#4
0
 internal sealed override bool TryParse(ref ParseState <TToken> state, ref ExpectedCollector <TToken> expecteds, out SourcePos result)
 {
     result = state.ComputeSourcePos();
     return(true);
 }
示例#5
0
 internal sealed override bool TryParse(ref ParseState <TToken> state, ref ExpectedCollector <TToken> expecteds, out T result)
 {
     result = _value;
     return(true);
 }