mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-28 19:14:54 +01:00
Merge HandleValue into the Step functions (#598)
* moved most of logic from HandleValue into the Step functions * removed the HandleValue function * added some comments * responses to Geoffrey * move increment of act->pos out of the step logic for value actions * changed act->pos to start at 0 and not have any gaps * Update executable_semantics/interpreter/action.h Co-authored-by: Geoff Romer <gromer@google.com> * update comment based on Geoffrey's suggestion Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
committed by
GitHub
co-authored by
Geoff Romer
parent
19e4bc55ce
commit
b60ef90d62
@@ -63,7 +63,7 @@ auto MakeExpAct(const Expression* e) -> Action* {
|
||||
auto* act = new Action();
|
||||
act->tag = ActionKind::ExpressionAction;
|
||||
act->u.exp = e;
|
||||
act->pos = -1;
|
||||
act->pos = 0;
|
||||
return act;
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ auto MakeLvalAct(const Expression* e) -> Action* {
|
||||
auto* act = new Action();
|
||||
act->tag = ActionKind::LValAction;
|
||||
act->u.exp = e;
|
||||
act->pos = -1;
|
||||
act->pos = 0;
|
||||
return act;
|
||||
}
|
||||
|
||||
@@ -79,7 +79,7 @@ auto MakeStmtAct(const Statement* s) -> Action* {
|
||||
auto* act = new Action();
|
||||
act->tag = ActionKind::StatementAction;
|
||||
act->u.stmt = s;
|
||||
act->pos = -1;
|
||||
act->pos = 0;
|
||||
return act;
|
||||
}
|
||||
|
||||
@@ -87,21 +87,21 @@ auto MakeValAct(const Value* v) -> Action* {
|
||||
auto* act = new Action();
|
||||
act->tag = ActionKind::ValAction;
|
||||
act->u.val = v;
|
||||
act->pos = -1;
|
||||
act->pos = 0;
|
||||
return act;
|
||||
}
|
||||
|
||||
auto MakeExpToLvalAct() -> Action* {
|
||||
auto* act = new Action();
|
||||
act->tag = ActionKind::ExpToLValAction;
|
||||
act->pos = -1;
|
||||
act->pos = 0;
|
||||
return act;
|
||||
}
|
||||
|
||||
auto MakeDeleteAct(Address a) -> Action* {
|
||||
auto* act = new Action();
|
||||
act->tag = ActionKind::DeleteTmpAction;
|
||||
act->pos = -1;
|
||||
act->pos = 0;
|
||||
act->u.delete_tmp = a;
|
||||
return act;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user