Skip to content

Commit 2e795d8

Browse files
committed
Remove vestigial let idea
1 parent 1a09674 commit 2e795d8

File tree

2 files changed

+0
-28
lines changed

2 files changed

+0
-28
lines changed

source/cppfront.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,13 +2134,6 @@ class cppfront
21342134
)
21352135
-> void
21362136
{
2137-
// TODO: If there's a let on this statement, generate a block scope
2138-
if (n.let) {
2139-
2140-
// TODO
2141-
2142-
}
2143-
21442137
printer.disable_indent_heuristic_for_next_text();
21452138

21462139
try_emit<statement_node::compound >(n.statement, function_prolog, function_epilog, function_indent);

source/parse.h

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -751,9 +751,6 @@ struct contract_node
751751
struct parameter_declaration_list_node;
752752
struct statement_node
753753
{
754-
token const* let;
755-
std::unique_ptr<parameter_declaration_list_node> let_params;
756-
757754
enum active { expression=0, compound, selection, declaration, return_, iteration, contract, inspect };
758755
std::variant<
759756
std::unique_ptr<expression_statement_node>,
@@ -839,11 +836,6 @@ struct parameter_declaration_list_node
839836
auto statement_node::visit(auto& v, int depth) -> void
840837
{
841838
v.start(*this, depth);
842-
if (let) {
843-
let->visit(v, depth+1);
844-
assert(let_params);
845-
let_params->visit(v, depth+1);
846-
}
847839
try_visit<expression >(statement, v, depth);
848840
try_visit<compound >(statement, v, depth);
849841
try_visit<selection >(statement, v, depth);
@@ -2471,19 +2463,6 @@ class parser
24712463
{
24722464
auto n = std::make_unique<statement_node>();
24732465

2474-
// Handle optional "let" before any statement
2475-
if (curr() == "let" && peek(1) && *peek(1) == "(") {
2476-
n->let = &curr();
2477-
next(); // now on the open paren
2478-
if (auto params = parameter_declaration_list()) {
2479-
n->let_params = std::move(params);
2480-
}
2481-
else {
2482-
error("invalid parameter list after 'let'");
2483-
return {};
2484-
}
2485-
}
2486-
24872466
// Now handle the rest of the statement
24882467

24892468
if (auto s = selection_statement()) {

0 commit comments

Comments
 (0)