Add underscores to private data members (#898)

This is the last PR I plan to have focused on #720
This commit is contained in:
Jon Meow
2021-10-19 14:27:10 -07:00
committed by GitHub
parent dc9c36660b
commit ffa4e76ede
17 changed files with 363 additions and 356 deletions
@@ -26,7 +26,7 @@ using Env = Dictionary<std::string, Address>;
class Interpreter {
public:
explicit Interpreter(Nonnull<Arena*> arena, bool trace)
: arena(arena), globals(arena), heap(arena), trace_(trace) {}
: arena_(arena), globals_(arena), heap_(arena), trace_(trace) {}
// Interpret the whole program.
auto InterpProgram(llvm::ArrayRef<Nonnull<Declaration*>> fs,
@@ -47,7 +47,7 @@ class Interpreter {
// Support TypeChecker allocating values on the heap.
auto AllocateValue(Nonnull<const Value*> v) -> Address {
return heap.AllocateValue(v);
return heap_.AllocateValue(v);
}
void InitEnv(const Declaration& d, Env* env);
@@ -152,14 +152,14 @@ class Interpreter {
void PrintState(llvm::raw_ostream& out);
Nonnull<Arena*> arena;
Nonnull<Arena*> arena_;
// Globally-defined entities, such as functions, structs, or choices.
Env globals;
Env globals_;
Stack<Nonnull<Frame*>> stack;
Heap heap;
std::optional<Nonnull<const Value*>> program_value;
Stack<Nonnull<Frame*>> stack_;
Heap heap_;
std::optional<Nonnull<const Value*>> program_value_;
bool trace_;
};