diff options
author | Vincent Ambo <tazjin@google.com> | 2020-05-21T04·43+0100 |
---|---|---|
committer | Vincent Ambo <tazjin@google.com> | 2020-05-21T04·43+0100 |
commit | a162f4e8258ce1d401bc1cdb018e1212db80772d (patch) | |
tree | cf78df573c740ec054aea483101be29e5fa06e8c /third_party/nix/src/libexpr/parser.y | |
parent | b97307056da53f094ab46e12f87d6a3f0a2be79f (diff) |
refactor(3p/nix/libexpr): Use std::string as qualified type r/797
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*
Diffstat (limited to 'third_party/nix/src/libexpr/parser.y')
-rw-r--r-- | third_party/nix/src/libexpr/parser.y | 18 |
1 files changed, 9 insertions, 9 deletions
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, vector<Ex continue; } - string s2; + std::string s2; for (size_t j = 0; j < e->s.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; |