File tree Expand file tree Collapse file tree 2 files changed +25
-3
lines changed
Expand file tree Collapse file tree 2 files changed +25
-3
lines changed Original file line number Diff line number Diff line change 112015-02-24 JJ Allaire <jj@rstudio.org>
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
672015-02-20 Lionel Henry <lionel.hry@gmail.com>
78
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments