Skip to content

Commit

Permalink
[cpp] Remove code made obsolete by last change
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy C committed Aug 31, 2023
1 parent ff2ec73 commit d13435e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 3 additions & 7 deletions cpp/pgen2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace pnode {

PNode::PNode(int typ, syntax_asdl::Token* tok, List<PNode*>*)
: typ(typ), child_offset(0), tok(tok), children() {
: typ(typ), tok(tok), children() {
}

void PNode::AddChild(PNode* node) {
Expand All @@ -19,15 +19,11 @@ PNode* PNode::GetChild(int i) {
if (j < 0) {
j += NumChildren();
}
return children[child_offset + j];
return children[j];
}

int PNode::NumChildren() {
return children.size() - child_offset;
}

void PNode::Advance(int n) {
child_offset += n;
return children.size();
}

PNodeAllocator::PNodeAllocator() : arena_(new std::vector<PNode>()) {
Expand Down
2 changes: 0 additions & 2 deletions cpp/pgen2.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,8 @@ class PNode {
void AddChild(PNode* node);
PNode* GetChild(int i);
int NumChildren();
void Advance(int n);

int typ;
int child_offset;
syntax_asdl::Token* tok;
std::vector<PNode*> children;
};
Expand Down

0 comments on commit d13435e

Please sign in to comment.