예제 #1
0
 /// <summary>
 /// Whether or not this plugin is a match for the token supplied.
 /// </summary>
 /// <param name="current"></param>
 /// <returns></returns>
 public override bool CanHandle(Token current)
 {
     if (_parser.Context.Symbols.Contains(current.Text))
     {
         return(false);
     }
     return(AliasMap.ContainsKey(current.Text));
 }
예제 #2
0
        /// <summary>
        /// Whether or not this plugin can handle the current token supplied which may be the current token
        /// or the next token.
        /// </summary>
        /// <param name="token">Current or Next token</param>
        /// <param name="isCurrent">Indicates if token supplied is the current token</param>
        /// <returns></returns>
        public override bool CanHandle(Token token, bool isCurrent)
        {
            if (token.Kind != TokenKind.Ident)
            {
                return(false);
            }

            if (_parser.Context.Symbols.Contains(token.Text))
            {
                return(false);
            }
            return(AliasMap.ContainsKey(token.Text));
        }