示例#1
0
 public bool InternVariable(Token token, Token typeToken, out Var var)
 {
     if (token != null && token.IsVariable)
     {
         var = CurrentScope.FindVar(token.ToString());
         if (var == null)
         {
             var = CurrentScope.CreateVar(token, typeToken);
             return(true); //was interned
         }
     }
     var = null; //must assign out before return.
     return(false);
 }