Example #1
0
 /// <summary>
 /// Constructs a new instance of <see cref="CompositeTokenMatchLocation"/>.
 /// </summary>
 public CompositeTokenMatchLocation(ITokenLocationMatch leftToken, ITokenLocationMatch rightToken)
 {
     this.leftToken     = leftToken;
     this.rightToken    = rightToken;
     this.minTokenIndex = new Lazy <int>(() => Math.Min(leftToken.MinTokenIndex, rightToken.MinTokenIndex));
     this.maxTokenIndex = new Lazy <int>(() => Math.Max(leftToken.MaxTokenIndex, rightToken.MaxTokenIndex));
 }
                static CompositeTokenMatchLocation CreateCompositeTokenMatchLocation(bool swapTokens, ITokenLocationMatch currentToken, ITokenLocationMatch nextToken)
                {
                    if (swapTokens)
                    {
                        return(new CompositeTokenMatchLocation(nextToken, currentToken));
                    }

                    return(new CompositeTokenMatchLocation(currentToken, nextToken));
                }