forward functionId from MacroFile to Macro 77/19377/2
Antoine ELIAS [Tue, 15 Aug 2017 08:35:43 +0000 (10:35 +0200)]
Change-Id: I24b15e45a45c6e93cfe5b953055f817897eb6f38

scilab/modules/ast/includes/types/callable.hxx
scilab/modules/ast/src/cpp/types/macro.cpp
scilab/modules/ast/src/cpp/types/macrofile.cpp

index 8f4b1bf..85b9005 100644 (file)
@@ -130,6 +130,16 @@ public :
         m_iLastLine  = _iLastLine;
     }
 
+    virtual void setFunctionId(uint64_t fId)
+    {
+        m_functionId = fId;
+    }
+
+    virtual uint64_t getFunctionId()
+    {
+        return m_functionId;
+    }
+
 protected :
     std::wstring            m_wstName;
     std::string             m_stName;
index ab26d79..c316756 100644 (file)
@@ -319,7 +319,7 @@ Callable::ReturnValue Macro::call(typed_list &in, optional_list &opt, int _iRetC
         ConfigVariable::setPromptMode(-1);
 
         //use version from analyze
-        if (m_functionId != -1) 
+        if (m_functionId != (uint64_t)-1) 
         {
             //std::wcerr << "macro functionId: " << m_functionId << std::endl;
             ast::Exp* exp = FBlockListener::getExp(m_functionId);
index 53d9a14..2c7cb07 100644 (file)
@@ -74,6 +74,8 @@ Callable::ReturnValue MacroFile::call(typed_list &in, optional_list &opt, int _i
     parse();
     if (m_pMacro)
     {
+        //forward functionId to internal macro
+        m_pMacro->setFunctionId(m_functionId);
         return m_pMacro->call(in, opt, _iRetCount, out);
     }
     else