about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/parser.cc
diff options
context:
space:
mode:
authorKane York <kanepyork@gmail.com>2020-08-10T05·42-0700
committerkanepyork <rikingcoding@gmail.com>2020-08-10T22·16+0000
commit906f5c1d2d442b1d34621b97950c38c659b729a6 (patch)
tree48b663ee52e56f8471539afece70de67a0144622 /third_party/nix/src/libexpr/parser.cc
parent42bdaacca62ad5760e5d46315f1e6dc2bcc3fd96 (diff)
fix(3p/nix): inherit Expr from gc, make parser state traceable r/1633
The parser contained vectors, and the primary parser state, that
were not participating in GC tracing.

Change-Id: Ie198592cd7acffd390e3e2ae9595138b56416838
Reviewed-on: https://cl.tvl.fyi/c/depot/+/1706
Tested-by: BuildkiteCI
Reviewed-by: tazjin <mail@tazj.in>
Reviewed-by: glittershark <grfn@gws.fyi>
Diffstat (limited to 'third_party/nix/src/libexpr/parser.cc')
-rw-r--r--third_party/nix/src/libexpr/parser.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/third_party/nix/src/libexpr/parser.cc b/third_party/nix/src/libexpr/parser.cc
index a96d345cc126..29d31661c896 100644
--- a/third_party/nix/src/libexpr/parser.cc
+++ b/third_party/nix/src/libexpr/parser.cc
@@ -92,8 +92,7 @@ void addFormal(const Pos& pos, Formals* formals, const Formal& formal) {
   formals->argNames.insert(formal.name);
 }
 
-Expr* stripIndentation(const Pos& pos, SymbolTable& symbols,
-                       std::vector<Expr*>& es) {
+Expr* stripIndentation(const Pos& pos, SymbolTable& symbols, VectorExprs& es) {
   if (es.empty()) {
     return new ExprString(symbols.Create(""));
   }
@@ -138,11 +137,11 @@ Expr* stripIndentation(const Pos& pos, SymbolTable& symbols,
   }
 
   /* Strip spaces from each line. */
-  std::vector<Expr*>* es2 = new std::vector<Expr*>;
+  VectorExprs* es2 = new VectorExprs;
   atStartOfLine = true;
   size_t curDropped = 0;
   size_t n = es.size();
-  for (std::vector<Expr*>::iterator i = es.begin(); i != es.end(); ++i, --n) {
+  for (VectorExprs::iterator i = es.begin(); i != es.end(); ++i, --n) {
     ExprIndStr* e = dynamic_cast<ExprIndStr*>(*i);
     if (!e) {
       atStartOfLine = false;