1
This commit is contained in:
parent
bb2f76674d
commit
b075c000c2
@ -158,6 +158,9 @@ namespace a8
|
|||||||
if (token == "(") {
|
if (token == "(") {
|
||||||
List new_list = std::make_shared<std::vector<std::shared_ptr<Value>>>();
|
List new_list = std::make_shared<std::vector<std::shared_ptr<Value>>>();
|
||||||
stack.push_back(new_list);
|
stack.push_back(new_list);
|
||||||
|
if (depth >= 0) {
|
||||||
|
stack.at(depth)->push_back(std::make_shared<Value>(new_list));
|
||||||
|
}
|
||||||
++depth;
|
++depth;
|
||||||
} else if (token == ")") {
|
} else if (token == ")") {
|
||||||
--depth;
|
--depth;
|
||||||
@ -178,7 +181,9 @@ namespace a8
|
|||||||
}
|
}
|
||||||
stack.at(depth)->push_back(symbol);
|
stack.at(depth)->push_back(symbol);
|
||||||
} else {
|
} else {
|
||||||
abort();
|
Symbol symbol;
|
||||||
|
symbol.name = token;
|
||||||
|
stack.at(depth)->push_back(std::make_shared<Value>(symbol));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -47,7 +47,7 @@ namespace a8
|
|||||||
a8::XObject ToXObject();
|
a8::XObject ToXObject();
|
||||||
};
|
};
|
||||||
|
|
||||||
class Scope
|
class Scope : public std::enable_shared_from_this<Scope>
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
std::shared_ptr<Value> Find(const std::string& name);
|
std::shared_ptr<Value> Find(const std::string& name);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user