From a162f4e8258ce1d401bc1cdb018e1212db80772d Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Thu, 21 May 2020 05:43:22 +0100 Subject: refactor(3p/nix/libexpr): Use std::string as qualified type Replaces most uses of `string` with `std::string`. This came up because I removed the "types.hh" import from "symbol-table.hh", which percolated through a bunch of files where `string` was suddenly no longer defined ... *sigh* --- third_party/nix/src/libexpr/parser.y | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'third_party/nix/src/libexpr/parser.y') diff --git a/third_party/nix/src/libexpr/parser.y b/third_party/nix/src/libexpr/parser.y index f5a25d5934c5..bd62a7fd0f52 100644 --- a/third_party/nix/src/libexpr/parser.y +++ b/third_party/nix/src/libexpr/parser.y @@ -30,7 +30,7 @@ namespace nix { Expr * result; Path basePath; Symbol path; - string error; + std::string error; Symbol sLetBody; ParseData(EvalState & state) : state(state) @@ -199,7 +199,7 @@ static Expr * stripIndentation(const Pos & pos, SymbolTable & symbols, vectors.size(); ++j) { if (atStartOfLine) { if (e->s[j] == ' ') { @@ -396,7 +396,7 @@ expr_simple | PATH { $$ = new ExprPath(absPath($1, data->basePath)); } | HPATH { $$ = new ExprPath(getHome() + string{$1 + 1}); } | SPATH { - string path($1 + 1, strlen($1) - 2); + std::string path($1 + 1, strlen($1) - 2); $$ = new ExprApp(CUR_POS, new ExprApp(new ExprVar(data->symbols.Create("__findFile")), new ExprVar(data->symbols.Create("__nixPath"))), @@ -601,13 +601,13 @@ Expr * EvalState::parseExprFromFile(const Path & path, StaticEnv & staticEnv) } -Expr * EvalState::parseExprFromString(const string & s, const Path & basePath, StaticEnv & staticEnv) +Expr * EvalState::parseExprFromString(const std::string & s, const Path & basePath, StaticEnv & staticEnv) { return parse(s.c_str(), "(string)", basePath, staticEnv); } -Expr * EvalState::parseExprFromString(const string & s, const Path & basePath) +Expr * EvalState::parseExprFromString(const std::string & s, const Path & basePath) { return parseExprFromString(s, basePath, staticBaseEnv); } @@ -620,10 +620,10 @@ Expr * EvalState::parseStdin() } -void EvalState::addToSearchPath(const string & s) +void EvalState::addToSearchPath(const std::string & s) { size_t pos = s.find('='); - string prefix; + std::string prefix; Path path; if (pos == string::npos) { path = s; @@ -636,13 +636,13 @@ void EvalState::addToSearchPath(const string & s) } -Path EvalState::findFile(const string & path) +Path EvalState::findFile(const std::string & path) { return findFile(searchPath, path); } -Path EvalState::findFile(SearchPath & searchPath, const string & path, const Pos & pos) +Path EvalState::findFile(SearchPath & searchPath, const std::string & path, const Pos & pos) { for (auto & i : searchPath) { std::string suffix; -- cgit 1.4.1