Skip to content

Commit bbb51b7

Browse files
Yaraslautchristianparpart
authored andcommitted
Rename to getenv
1 parent 5eb9645 commit bbb51b7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

src/shell/ASTPrinter.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class ASTPrinter: public Visitor
9292

9393
void visit(VariableSubstExpr const& node) override
9494
{
95-
_result += "substitute";
95+
_result += "getenv";
9696

9797
if (node.name)
9898
{

src/shell/IRGenerator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ export class IRGenerator final: public CoreVM::IRBuilder, public ast::Visitor
113113
callArguments.push_back(codegen(node.name.get()));
114114
}
115115

116-
_result = createCallFunction(getBuiltinFunction(node.callback.get()), callArguments, "get");
116+
_result = createCallFunction(getBuiltinFunction(node.callback.get()), callArguments, "getenv");
117117
}
118118

119119
void visit(ast::BuiltinFalseStmt const&) override { _result = get(CoreVM::CoreNumber(1)); }

src/shell/Parser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ export class Parser
9292
case Token::DollarName: {
9393
auto name = std::make_unique<ast::LiteralExpr>(_lexer.currentLiteral());
9494
_lexer.nextToken();
95-
return std::make_unique<ast::VariableSubstExpr>(*_runtime.find("substitute(S)S"), std::move(name));
95+
return std::make_unique<ast::VariableSubstExpr>(*_runtime.find("getenv(S)S"), std::move(name));
9696
}
9797
case Token::String:
9898
case Token::Identifier:

src/shell/Shell.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ export class Shell final: public CoreVM::Runtime
326326
.returnType(CoreVM::LiteralType::Boolean)
327327
.bind(&Shell::builtinSet, this);
328328

329-
registerFunction("substitute")
329+
registerFunction("getenv")
330330
.param<std::string>("name")
331331
.returnType(CoreVM::LiteralType::String)
332332
.bind(&Shell::builtinVariableSubst, this);

0 commit comments

Comments
 (0)