Index: code/branches/console/src/core/CommandEvaluation.cc
===================================================================
--- code/branches/console/src/core/CommandEvaluation.cc	(revision 1351)
+++ code/branches/console/src/core/CommandEvaluation.cc	(revision 1390)
@@ -52,5 +52,5 @@
         this->bEvaluatedParams_ = false;
 
-        this->listOfPossibleFunctionClasses_.clear();
+        this->listOfPossibleIdentifiers_.clear();
         this->listOfPossibleFunctions_.clear();
 
@@ -64,16 +64,5 @@
     bool CommandEvaluation::isValid() const
     {
-        if (this->state_ == CS_Shortcut_Params || this->state_ == CS_Shortcut_Finished)
-        {
-            return this->function_;
-        }
-        else if (this->state_ == CS_Function_Params || this->state_ == CS_Function_Finished)
-        {
-            return (this->functionclass_ && this->function_);
-        }
-        else
-        {
-            return false;
-        }
+        return (this->function_);
     }
 
@@ -94,7 +83,7 @@
         unsigned int startindex = this->getStartindex();
         if (this->originalCommandTokens_.size() > startindex)
-            return evaluation.shortcut_->parse(removeSlashes(this->originalCommandTokens_.subSet(startindex).join() + evaluation.getAdditionalParameter()));
+            return this->function_->parse(removeSlashes(this->originalCommandTokens_.subSet(startindex).join() + this->getAdditionalParameter()));
         else
-            return evaluation.shortcut_->parse(removeSlashes(evaluation.additionalParameter_));
+            return this->function_->parse(removeSlashes(this->additionalParameter_));
     }
 
@@ -103,24 +92,33 @@
         switch (this->state_)
         {
+            case CS_Uninitialized:
             case CS_Empty:
-                std::list<std::pair<const std::string*, const std::string*> > temp;
-                if (evaluation.state_ == CS_Empty)
-                {
-                    temp.insert(temp.end(), this->listOfPossibleFunctions_.begin(), this->listOfPossibleFunctions_.end());
-                    temp.insert(temp.end(), this->listOfPossibleFunctionClasses_.begin(), this->listOfPossibleFunctionClasses_.end());
-                }
-                return (CommandEvaluation::getCommonBegin(temp));
+            case CS_ShortcutOrIdentifier:
+                {
+                    std::list<std::pair<const std::string*, const std::string*> > temp;
+                    if (this->state_ == CS_Empty)
+                    {
+                        temp.insert(temp.end(), this->listOfPossibleFunctions_.begin(), this->listOfPossibleFunctions_.end());
+                        temp.insert(temp.end(), this->listOfPossibleIdentifiers_.begin(), this->listOfPossibleIdentifiers_.end());
+                    }
+                    return (CommandEvaluation::getCommonBegin(temp));
+                }
                 break;
             case CS_Shortcut_Params:
                 if (this->function_)
-                    return (this->function_->getName() + " ");
+                {
+                    if (this->commandTokens_.size() > 1)
+                        return (this->function_->getName() + " " + this->commandTokens_.subSet(1, this->commandTokens_.size() - 1).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
+                    else
+                        return (this->function_->getName() + " ");
+                }
                 break;
             case CS_Shortcut_Finished:
                 if (this->function_)
                 {
-                    if (this->function_->getParamCount() == 0)
+                    if (this->commandTokens_.size() > 1)
+                        return (this->function_->getName() + " " + this->originalCommandTokens_.subSet(1, this->originalCommandTokens_.size() - 1).join());
+                    else
                         return (this->function_->getName());
-                    else if (this->originalCommandTokens_.size() > 1)
-                        return (this->function_->getName() + " " + this->originalCommandTokens_.subSet(1).join());
                 }
                 break;
@@ -131,14 +129,21 @@
             case CS_Function_Params:
                 if (this->functionclass_ && this->function_)
-                    return (this->functionclass_->getName() + " " + this->function_->getName() + " ");
+                {
+                    if (this->commandTokens_.size() > 2)
+                        return (this->functionclass_->getName() + " " + this->function_->getName() + " " + this->commandTokens_.subSet(2, this->commandTokens_.size() - 1).join() + " " + CommandEvaluation::getCommonBegin(this->listOfPossibleArguments_));
+                    else
+                        return (this->functionclass_->getName() + " " + this->function_->getName() + " ");
+                }
                 break;
             case CS_Function_Finished:
                 if (this->functionclass_ && this->function_)
                 {
-                    if (this->function_->getParamCount() == 0)
-                        return (this->functionclass_->getName() + " " + this->unction_->getName());
-                    else if (this->originalCommandTokens_.size() > 2)
-                        return (this->functionclass_->getName() + " " + this->function_->getName() + " " + this->originalCommandTokens_.subSet(2).join());
-                }
+                    if (this->commandTokens_.size() > 2)
+                        return (this->functionclass_->getName() + " " + this->function_->getName() + " " + this->originalCommandTokens_.subSet(2, this->originalCommandTokens_.size() - 1).join());
+                    else
+                        return (this->functionclass_->getName() + " " + this->function_->getName());
+                }
+               break;
+            case CS_Error:
                 break;
         }
@@ -151,6 +156,9 @@
         switch (this->state_)
         {
+            case CS_Uninitialized:
+                break;
             case CS_Empty:
-                return (CommandEvaluation::dump(this->listOfPossibleFunctions_) + "\n" + CommandExecutor::dump(this->listOfPossibleFunctionClasses_));
+            case CS_ShortcutOrIdentifier:
+                return (CommandEvaluation::dump(this->listOfPossibleFunctions_) + "\n" + CommandEvaluation::dump(this->listOfPossibleIdentifiers_));
                 break;
             case CS_Function:
@@ -158,6 +166,7 @@
                 break;
             case CS_Shortcut_Params:
+            case CS_Function_Params:
+                return CommandEvaluation::dump(this->listOfPossibleArguments_);
             case CS_Shortcut_Finished:
-            case CS_Function_Params:
             case CS_Function_Finished:
                 if (this->function_)
@@ -175,5 +184,4 @@
     {
         this->bEvaluatedParams_ = false;
-        this->evaluatedExecutor_ = 0;
 
         for (unsigned int i = 0; i < MAX_FUNCTOR_ARGUMENTS; i++)
@@ -188,16 +196,10 @@
         {
             if (this->function_->evaluate(this->getAdditionalParameter(), this->param_, " "))
-            {
                 this->bEvaluatedParams_ = true;
-                this->evaluatedExecutor_ = this->function_;
-            }
         }
         else if (this->originalCommandTokens_.size() > startindex)
         {
             if (this->function_->evaluate(this->originalCommandTokens_.subSet(startindex).join() + this->getAdditionalParameter(), this->param_, " "))
-            {
                 this->bEvaluatedParams_ = true;
-                this->evaluatedExecutor_ = this->function_;
-            }
         }
     }
@@ -238,5 +240,5 @@
         if (this->state_ == CS_Shortcut_Params || this->state_ == CS_Shortcut_Finished)
             return 1;
-        else if (this->state_ == CS_Function_Params || this->state_ == CS_Function_Finished)
+        else if (this->state_ == CS_Function || this->state_ == CS_Function_Params || this->state_ == CS_Function_Finished)
             return 2;
         else
