Skip to content

Commit

Permalink
Rename to getenv
Browse files Browse the repository at this point in the history
  • Loading branch information
Yaraslaut committed Dec 23, 2023
1 parent aac089b commit 8b38ef7
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/shell/ASTPrinter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ export class ASTPrinter: public Visitor

void visit(VariableSubstExpr const& node) override
{
_result += "substitute";
_result += "getenv";

if (node.name)
{
Expand Down
2 changes: 1 addition & 1 deletion src/shell/IRGenerator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export class IRGenerator final: public CoreVM::IRBuilder, public ast::Visitor
callArguments.push_back(codegen(node.name.get()));
}

_result = createCallFunction(getBuiltinFunction(node.callback.get()), callArguments, "get");
_result = createCallFunction(getBuiltinFunction(node.callback.get()), callArguments, "getenv");
}

void visit(ast::BuiltinFalseStmt const&) override { _result = get(CoreVM::CoreNumber(1)); }
Expand Down
2 changes: 1 addition & 1 deletion src/shell/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export class Parser
case Token::DollarName: {
auto name = std::make_unique<ast::LiteralExpr>(_lexer.currentLiteral());
_lexer.nextToken();
return std::make_unique<ast::VariableSubstExpr>(*_runtime.find("substitute(S)S"), std::move(name));
return std::make_unique<ast::VariableSubstExpr>(*_runtime.find("getenv(S)S"), std::move(name));
}
case Token::String:
case Token::Identifier:
Expand Down
2 changes: 1 addition & 1 deletion src/shell/Shell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,7 @@ export class Shell final: public CoreVM::Runtime
.returnType(CoreVM::LiteralType::Boolean)
.bind(&Shell::builtinSet, this);

registerFunction("substitute")
registerFunction("getenv")
.param<std::string>("name")
.returnType(CoreVM::LiteralType::String)
.bind(&Shell::builtinVariableSubst, this);
Expand Down

0 comments on commit 8b38ef7

Please sign in to comment.