summaryrefslogtreecommitdiff
path: root/src/expand/include.cpp
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2019-05-15 21:19:57 +0800
committerJohn Hodge <tpg@ucc.asn.au>2019-05-15 21:19:57 +0800
commit0f59ded4389202468dd5bcb420724395afbfe1f7 (patch)
tree9c8058e576d1cf03e1dd05757d70a028e69250f4 /src/expand/include.cpp
parent894950e87dc8c7631fe38cdfe47170ce1f94c062 (diff)
downloadmrust-0f59ded4389202468dd5bcb420724395afbfe1f7.tar.gz
Expand - Track include!/include_str!/include_bytes! files for dependencies
Diffstat (limited to 'src/expand/include.cpp')
-rw-r--r--src/expand/include.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/expand/include.cpp b/src/expand/include.cpp
index 59f33d47..8078d5d0 100644
--- a/src/expand/include.cpp
+++ b/src/expand/include.cpp
@@ -12,6 +12,7 @@
#include <parse/ttstream.hpp>
#include <parse/lex.hpp> // Lexer (new files)
#include <ast/expr.hpp>
+#include <ast/crate.hpp>
namespace {
@@ -75,6 +76,7 @@ class CIncludeExpander:
GET_CHECK_TOK(tok, lex, TOK_EOF);
::std::string file_path = get_path_relative_to(mod.m_file_info.path, mv$(path));
+ crate.m_extra_files.push_back(file_path);
try {
return box$( Lexer(file_path) );
@@ -101,6 +103,7 @@ class CIncludeBytesExpander:
GET_CHECK_TOK(tok, lex, TOK_EOF);
::std::string file_path = get_path_relative_to(mod.m_file_info.path, mv$(path));
+ crate.m_extra_files.push_back(file_path);
::std::ifstream is(file_path);
if( !is.good() ) {
@@ -130,6 +133,7 @@ class CIncludeStrExpander:
GET_CHECK_TOK(tok, lex, TOK_EOF);
::std::string file_path = get_path_relative_to(mod.m_file_info.path, mv$(path));
+ crate.m_extra_files.push_back(file_path);
::std::ifstream is(file_path);
if( !is.good() ) {