[opengtl-commits] [553] * report error when the module wasn't found

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 553
Author:   cyrille
Date:     2008-12-20 11:51:18 +0100 (Sat, 20 Dec 2008)

Log Message:
-----------
* report error when the module wasn't found

Modified Paths:
--------------
    trunk/OpenGTL/OpenCTL/OpenCTL/compiler/Compiler.cpp
    trunk/OpenGTL/OpenCTL/OpenCTL/compiler/ParserNG.cpp


Modified: trunk/OpenGTL/OpenCTL/OpenCTL/compiler/Compiler.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/compiler/Compiler.cpp	2008-12-20 10:50:52 UTC (rev 552)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/compiler/Compiler.cpp	2008-12-20 10:51:18 UTC (rev 553)
@@ -208,6 +208,7 @@
 bool Compiler::importModule(const GTLCore::String& name)
 {
   Module* m = ModulesManager::instance()->loadModule( name );
+  GTL_DEBUG("Importing module : " << name << " " << m );
   if( m )
   {
     // Attempt to compile the module if it isn't yet compiled
@@ -227,6 +228,7 @@
     foreach( GTLCore::Function* function, functions )
     {
       GTLCore::Function* newFunction = GTLCore::Function::Private::createExternalFunction( d->moduleData, function );
+      OCTL_DEBUG("Import function: " << newFunction->name() );
       declareFunction( newFunction->name(), newFunction );
       functionsToDelete().push_back( newFunction );
     }

Modified: trunk/OpenGTL/OpenCTL/OpenCTL/compiler/ParserNG.cpp
===================================================================
--- trunk/OpenGTL/OpenCTL/OpenCTL/compiler/ParserNG.cpp	2008-12-20 10:50:52 UTC (rev 552)
+++ trunk/OpenGTL/OpenCTL/OpenCTL/compiler/ParserNG.cpp	2008-12-20 10:51:18 UTC (rev 553)
@@ -126,7 +126,10 @@
         getNextToken();
         if( isOfType( currentToken(), GTLCore::Token::STRING_CONSTANT ) )
         {
-          d->compiler->importModule( currentToken().string );
+          if(not d->compiler->importModule( currentToken().string ) )
+          {
+            reportError( "Fail to import module '" + currentToken().string + "'.", currentToken() );
+          }
         }
         checkNextTokenIsSemi();
       }


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/