summaryrefslogtreecommitdiff
path: root/src/lexer.l
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2012-02-17 22:05:36 (GMT)
committerMarius Kintel <marius@kintel.net>2012-02-17 22:05:36 (GMT)
commit2316127e62ba4c4c0e49cd35d869fcaeca357a29 (patch)
treed4876248cb049d58583d97bb1b716db6815904b2 /src/lexer.l
parent6845399e497726958d51170f906474e2624848c4 (diff)
Handle include dependencies
Diffstat (limited to 'src/lexer.l')
-rw-r--r--src/lexer.l10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lexer.l b/src/lexer.l
index 5e24e7f..884275e 100644
--- a/src/lexer.l
+++ b/src/lexer.l
@@ -30,6 +30,7 @@
#include "printutils.h"
#include "parsersettings.h"
#include "parser_yacc.h"
+#include "module.h"
#include <assert.h>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
@@ -52,7 +53,8 @@ int lexerget_lineno(void);
static void yyunput(int, char*) __attribute__((unused));
#endif
extern const char *parser_input_buffer;
- extern std::string parser_source_path;
+extern std::string parser_source_path;
+extern Module *currmodule;
#define YY_INPUT(buf,result,max_size) { \
if (yyin && yyin != stdin) { \
@@ -219,8 +221,10 @@ void includefile()
filepath.clear();
path_stack.push_back(finfo.parent_path());
- handle_dep(boosty::absolute(finfo).string());
- yyin = fopen(boosty::absolute(finfo).string().c_str(), "r");
+ std::string fullname = boosty::absolute(finfo).string();
+ handle_dep(fullname);
+ currmodule->registerInclude(fullname);
+ yyin = fopen(fullname.c_str(), "r");
if (!yyin) {
PRINTB("WARNING: Can't open input file '%s'.", filename);
path_stack.pop_back();
contact: Jan Huwald // Impressum