Example #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="MatchKeyword"/> class.
 /// </summary>
 /// <param name="tokenType">The type.</param>
 /// <param name="keyword">The keyword.</param>
 public MatchKeyword(TokenType tokenType, string keyword)
 {
     tokenType.CheckNull("tokenType");
     keyword.CheckNull("keyword");
     keyword.Check(
         s => !string.IsNullOrEmpty(s), s => new ArgumentException("The keyword cannot be an empty string."));
     this.Keyword           = keyword;
     this.keywordCharacters = keyword.Select(c => c.ToString(CultureInfo.InvariantCulture)).ToArray();
     this.TokenType         = tokenType;
     this.AllowAsSubString  = true;
 }