Skip to content

Commit b979d29

Browse files
committed
process attributes in included files
1 parent 05608c8 commit b979d29

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
2015-02-24 JJ Allaire <[email protected]>
22

33
* src/attributes.cpp: Guard against includes referencing themselves
4-
(and thus creating an endless loop of include processing).
4+
(and thus creating an endless loop of include processing); Process
5+
attributes in included files.
56

67
2015-02-20 Lionel Henry <[email protected]>
78

src/attributes.cpp

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,9 +1084,30 @@ namespace attributes {
10841084
// Parse embedded R
10851085
embeddedR_ = parseEmbeddedR(lines_, lines);
10861086

1087-
// Recursively parse local includes
1088-
if (localIncludes)
1087+
// Recursively parse local includes if requested
1088+
if (localIncludes) {
1089+
1090+
// get local includes
10891091
localIncludes_ = parseLocalIncludes(sourceFile);
1092+
1093+
// parse attributes and modules from each local include
1094+
for (size_t i = 0; i<localIncludes_.size(); i++) {
1095+
1096+
// perform parse
1097+
std::string include = localIncludes_[i].path();
1098+
SourceFileAttributesParser parser(include, false);
1099+
1100+
// copy to base attributes
1101+
std::copy(parser.begin(),
1102+
parser.end(),
1103+
std::back_inserter(attributes_));
1104+
1105+
// copy to base modules
1106+
std::copy(parser.modules().begin(),
1107+
parser.modules().end(),
1108+
std::back_inserter(modules_));
1109+
}
1110+
}
10901111
}
10911112
}
10921113

0 commit comments

Comments
 (0)