Commit ca0690c7 by Aaron Leung

Giving a field a better name.

parent c8478d3b
......@@ -4,12 +4,15 @@ namespace Sass {
using std::map;
struct Environment {
map<Token, Node> frame;
map<Token, Node> current_frame;
Environment* parent;
Environment() : frame(map<Token, Node>()), parent(0)
Environment()
: current_frame(map<Token, Node>()), parent(0)
{ }
Environment(Environment* env) : frame(map<Token, Node>()), parent(env)
Environment(Environment* env)
: current_frame(map<Token, Node>()),
parent(env)
{ }
void link(Environment& env)
......@@ -17,16 +20,16 @@ namespace Sass {
bool query(const Token& key) const
{
if (frame.count(key)) return true;
if (current_frame.count(key)) return true;
else if (parent) return parent->query(key);
else return false;
}
Node& operator[](const Token& key)
{
if (frame.count(key)) return frame[key];
if (current_frame.count(key)) return current_frame[key];
else if (parent) return (*parent)[key];
else return frame[key];
else return current_frame[key];
}
};
......
......@@ -46,7 +46,7 @@ namespace Sass {
env[expr[0].token] = val;
}
else {
env.frame[expr[0].token] = val;
env.current_frame[expr[0].token] = val;
}
return expr;
} break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment