From 947311013978605f84bcf542cd39d5cc443285ed Mon Sep 17 00:00:00 2001
From: Kubat <mael.martin31@gmail.com>
Date: Thu, 10 Feb 2022 23:06:19 +0100
Subject: [PATCH] PARSER: Drop the callable type in the declaration before
 getting the name

---
 src/Lib/Script/Ast/Parser/IrRoot.hh | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/Lib/Script/Ast/Parser/IrRoot.hh b/src/Lib/Script/Ast/Parser/IrRoot.hh
index afe926cd..63aca34f 100644
--- a/src/Lib/Script/Ast/Parser/IrRoot.hh
+++ b/src/Lib/Script/Ast/Parser/IrRoot.hh
@@ -40,9 +40,6 @@ while (tokenListIsNotEmpty(tokens)) {
                                  firstToken.toString());
     }
 
-    /* DEBUG */
-    std::cerr << firstToken.toString() << "\n";
-
     /*
     ** Parse attribute. We need to take all the tokens in another vector and
     ** construct the attribute after the next object is completed
@@ -117,6 +114,7 @@ while (tokenListIsNotEmpty(tokens)) {
         tokensForInnerInstructions.erase(std::begin(tokensForInnerInstructions));
         tokensForInnerInstructions.pop_back();
 
+        getInnerTokenOpt(tokenListPop(&tokensForSignature)).assertTypeSimple(TOKEN_FUNCTION);
         Token name = getInnerTokenOpt(tokenListPop(&tokensForSignature));
         name.assertType(Token::Type::QNAME);
 
@@ -145,6 +143,7 @@ while (tokenListIsNotEmpty(tokens)) {
         tokensForInnerInstructions.erase(std::begin(tokensForInnerInstructions));
         tokensForInnerInstructions.pop_back();
 
+        getInnerTokenOpt(tokenListPop(&tokensForSignature)).assertTypeSimple(TOKEN_JOB);
         Token name = getInnerTokenOpt(tokenListPop(&tokensForSignature));
         name.assertType(Token::Type::QNAME);
 
-- 
GitLab