From 0889b3ddbec3b4ae99f0654dc0b0bd96819d7d3e Mon Sep 17 00:00:00 2001 From: wesuRage Date: Sat, 7 Dec 2024 16:38:07 -0300 Subject: [PATCH] fix(cpp): added 'extern "C"' to solve the error --- examples/a.glx | 4 +--- src/backend/generator/generator.test.cpp | 19 +++++++++++-------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/examples/a.glx b/examples/a.glx index 607f5b5..4096f4d 100644 --- a/examples/a.glx +++ b/examples/a.glx @@ -1,3 +1 @@ -..= -.. -... +int var := 3; \ No newline at end of file diff --git a/src/backend/generator/generator.test.cpp b/src/backend/generator/generator.test.cpp index 4679321..584aac6 100644 --- a/src/backend/generator/generator.test.cpp +++ b/src/backend/generator/generator.test.cpp @@ -1,13 +1,16 @@ #include #include -#include "frontend/lexer/core.h" -#include "utils.h" -#include "frontend/lexer/freeTokens.h" -#include "frontend/ast/definitions.h" -#include "frontend/parser/core.h" -#include "frontend/parser/printer/print_ast.h" -#include "frontend/getTokenTypeName.h" -#include "frontend/freeTokens.h" +extern "C" { + + #include "frontend/lexer/core.h" + #include "utils.h" + #include "frontend/lexer/freeTokens.h" + #include "frontend/ast/definitions.h" + #include "frontend/parser/core.h" + #include "frontend/parser/printer/print_ast.h" + #include "frontend/getTokenTypeName.h" + #include "frontend/freeTokens.h" +} /** * @brief The entry point of the program for lexical analysis and parsing.