mirror of
https://github.com/yhirose/cpp-peglib.git
synced 2025-01-22 21:35:29 +00:00
Fixed debuger problems.
This commit is contained in:
parent
86ef99d48a
commit
efcba540b1
@ -101,9 +101,9 @@ struct CommandLineDebugger
|
|||||||
}
|
}
|
||||||
|
|
||||||
shared_ptr<Ast> find_function_node(const Ast& ast) {
|
shared_ptr<Ast> find_function_node(const Ast& ast) {
|
||||||
auto node = ast.parent_node;
|
auto node = ast.parent;
|
||||||
while (node->parent_node && node->tag != "FUNCTION"_) {
|
while (node->parent && node->tag != "FUNCTION"_) {
|
||||||
node = node->parent_node;
|
node = node->parent;
|
||||||
}
|
}
|
||||||
return node;
|
return node;
|
||||||
}
|
}
|
||||||
@ -138,8 +138,12 @@ struct CommandLineDebugger
|
|||||||
set<string> references;
|
set<string> references;
|
||||||
enum_identifiers(*node, references);
|
enum_identifiers(*node, references);
|
||||||
for (const auto& symbol: references) {
|
for (const auto& symbol: references) {
|
||||||
const auto& val = env.get(symbol);
|
if (env.has(symbol)) {
|
||||||
cout << symbol << ": " << val.str() << endl;
|
const auto& val = env.get(symbol);
|
||||||
|
if (val.type != Value::Function) {
|
||||||
|
cout << symbol << ": " << val.str() << endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user