Source/NFX/CodeAnalysis/PatternSearch.cs
/// <summary>
/// Loops until token pattern match succeeds, conditionaly considering only primary language tokens.
/// Keeps state machine if match was found on the first matching token
/// </summary>
Loops until token pattern match succeeds, conditionaly considering only primary language tokens.
Keeps state machine if match was found on the first matching token
Loops until token pattern match succeeds conditionaly considering only primary language tokens . Keeps state machine if match was found on the first matching token
public static FSMI LoopUntilMatch<TToken>(this LazyFSMState<TToken> state,
                                        bool onlyPrimary,
                                        params LazyFSMPredicate<TToken>[] predicates
                                       ) where TToken : Token
       {
         var stream = state.Tokens;
         if (state.m_CurrentTokenIndex > 0)
          stream = stream.Skip(state.m_CurrentTokenIndex);
         LazyFSMState<TToken> subState = new LazyFSMState<TToken>();
         return stream.LazyFSM(onlyPrimary, ref subState, predicates) != null ? FSMI.AdvanceOnSameToken : FSMI.Loop;
       }
public static FSMI LoopUntilMatch < TToken > ( this LazyFSMState < TToken > state , bool onlyPrimary , params LazyFSMPredicate < TToken > [ ] predicates ) where TToken : Token { var stream = state . Tokens ; if ( state . m_CurrentTokenIndex > 0 ) stream = stream . Skip ( state . m_CurrentTokenIndex ) ; LazyFSMState < TToken > subState = new LazyFSMState < TToken > ( ) ; return stream . LazyFSM ( onlyPrimary , ref subState , predicates ) != null ? FSMI . AdvanceOnSameToken : FSMI . Loop ; }
Loops until token pattern match succeeds, conditionaly considering only primary language tokens.
Loops until token pattern match succeeds conditionaly considering only primary language tokens .
LazyFSMState<TToken>
this
onlyPrimary
bool