Exemplo n.º 1
0
 /// <summary>
 /// Adds a token to the inernal list of tokens
 /// </summary>
 /// <param name="category">the token category</param>
 /// <param name="enclosed">whether or not the token is enclosed in braces</param>
 /// <param name="range">the token range</param>
 private void AddToken(Token.TokenCategory category, bool enclosed, TokenRange range)
 {
     _tokens.Add(new Token(category, StringHelper.SubstringWithCheck(_filename, range.Offset, range.Size), enclosed));
 }
Exemplo n.º 2
0
 /// <summary>
 /// Returns whether or not the <code>result</code> matches the <code>category</code>.
 /// </summary>
 public bool IsTokenCategory(int result, Token.TokenCategory category)
 {
     return(Token.InListRange(result, _parser.Tokens) && _parser.Tokens[result].Category == category);
 }