aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-03-31 06:36:46 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-03-31 06:36:46 +0200
commit276a0796a97b0a312c0071bba0bf924b5f5c6eee (patch)
treeca876a7af9a63250b85efb973acc72b30c67143a /build
parent618c44ec5e85f7d07540234a0de9fac6e2913243 (diff)
Rename root_scope to global_scope
To avoid confusion with project's root scopes.
Diffstat (limited to 'build')
-rw-r--r--build/b.cxx2
-rw-r--r--build/context.cxx14
-rw-r--r--build/dump.cxx20
-rw-r--r--build/parser.cxx4
-rw-r--r--build/scope10
-rw-r--r--build/scope.cxx6
6 files changed, 28 insertions, 28 deletions
diff --git a/build/b.cxx b/build/b.cxx
index bd02052..e231aa3 100644
--- a/build/b.cxx
+++ b/build/b.cxx
@@ -253,7 +253,7 @@ main (int argc, char* argv[])
break;
parser p;
- t = p.parse_variable (l, *root_scope, t.name (), tt);
+ t = p.parse_variable (l, *global_scope, t.name (), tt);
if (t.type () != token_type::eos)
fail << "unexpected " << t << " in variable " << s;
diff --git a/build/context.cxx b/build/context.cxx
index 872a428..69b10d7 100644
--- a/build/context.cxx
+++ b/build/context.cxx
@@ -28,18 +28,18 @@ namespace build
scopes.clear ();
variable_pool.clear ();
- // Create root scope. For Win32 we use the empty path since there
- // is no such "real" root path. On POSIX, however, this is a real
- // path. See the comment in <build/path-map> for details.
+ // Create global scope. For Win32 we use the empty path since there
+ // is no "real" root path. On POSIX, however, this is a real path.
+ // See the comment in <build/path-map> for details.
//
#ifdef _WIN32
- root_scope = &scopes[path ()];
+ global_scope = &scopes[path ()];
#else
- root_scope = &scopes[path ("/")];
+ global_scope = &scopes[path ("/")];
#endif
- root_scope->variables["work"] = work;
- root_scope->variables["home"] = home;
+ global_scope->variables["work"] = work;
+ global_scope->variables["home"] = home;
}
mkdir_status
diff --git a/build/dump.cxx b/build/dump.cxx
index 45ec584..0287d4a 100644
--- a/build/dump.cxx
+++ b/build/dump.cxx
@@ -104,16 +104,16 @@ namespace build
if (ts == &p)
{
- // If this is the ultimate root scope, check that this target
- // hasn't been handled by the src logic below.
+ // If this is the global scope, check that this target hasn't
+ // been handled by the src logic below.
//
- f = (ts != root_scope || rts.find (&t) == rts.end ());
+ f = (ts != global_scope || rts.find (&t) == rts.end ());
}
- // If this target is in the ultimate root scope and we have a
- // corresponding src directory (i.e., we are a scope inside a
- // project), check whether this target is in our src.
+ // If this target is in the global scope and we have a corresponding
+ // src directory (i.e., we are a scope inside a project), check
+ // whether this target is in our src.
//
- else if (ts == root_scope && p.src_path_ != nullptr)
+ else if (ts == global_scope && p.src_path_ != nullptr)
{
if (t.dir.sub (p.src_path ()))
{
@@ -151,9 +151,9 @@ namespace build
string ind;
set<const target*> rts;
auto i (scopes.begin ());
- scope& r (i->second); // Root scope.
- assert (&r == root_scope);
- dump_scope (r, ++i, ind, rts);
+ scope& g (i->second); // Global scope.
+ assert (&g == global_scope);
+ dump_scope (g, ++i, ind, rts);
cerr << endl;
}
}
diff --git a/build/parser.cxx b/build/parser.cxx
index e2b11f0..1347ebd 100644
--- a/build/parser.cxx
+++ b/build/parser.cxx
@@ -803,7 +803,7 @@ namespace build
if (p == n)
{
// On Win32 translate the root path to the special empty path.
- // Search for root_scope for details.
+ // Search for global_scope for details.
//
#ifdef _WIN32
path dir (name != "/" ? path (name) : path ());
@@ -1057,7 +1057,7 @@ namespace build
lexer l (is, name);
lexer_ = &l;
- scope_ = root_ = root_scope;
+ scope_ = root_ = global_scope;
// Turn on pairs recognition with '@' as the pair separator (e.g.,
// src_root/@out_root/exe{foo bar}).
diff --git a/build/scope b/build/scope
index 8471a2a..0fa3025 100644
--- a/build/scope
+++ b/build/scope
@@ -61,15 +61,15 @@ namespace build
variable_map variables;
prerequisite_set prerequisites;
- // Meta/operations supported by this project (set on the project
- // root scope only).
+ // Meta/operations supported by this project (set on the root
+ // scope only).
//
meta_operation_table meta_operations;
operation_table operations;
// Set of buildfiles already loaded for this scope. The included
// buildfiles are checked against the project's root scope while
- // imported -- against the overall root scope (root_scope).
+ // imported -- against the global scope (global_scope).
//
std::unordered_set<path_type> buildfiles;
@@ -93,7 +93,7 @@ namespace build
{
public:
// Note that we assume the first insertion into the map is that
- // of the root scope.
+ // of the global scope.
//
std::pair<scope&, bool>
insert (const path&);
@@ -111,7 +111,7 @@ namespace build
};
extern scope_map scopes;
- extern scope* root_scope;
+ extern scope* global_scope;
}
#endif // BUILD_SCOPE
diff --git a/build/scope.cxx b/build/scope.cxx
index 60c83b4..f907163 100644
--- a/build/scope.cxx
+++ b/build/scope.cxx
@@ -33,7 +33,7 @@ namespace build
// scope_map
//
scope_map scopes;
- scope* root_scope;
+ scope* global_scope;
pair<scope&, bool> scope_map::
insert (const path& k)
@@ -46,7 +46,7 @@ namespace build
scope* p (nullptr);
// Update scopes of which we are a new parent (unless this is the
- // root scope).
+ // global scope).
//
if (size () > 1)
{
@@ -102,7 +102,7 @@ namespace build
if (i != end ())
return i->second;
- assert (!d.empty ()); // We should have the root scope.
+ assert (!d.empty ()); // We should have the global scope.
}
}
}