mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-19 09:20:27 +00:00
Support for as operator and user-defined As impls. (#1476)
This commit is contained in:
1 parent
a96ae98155
commit
93e19649aa
20 files changed
+208
-12
No files matched your search
@@ -176,6 +176,15 @@ auto ActionStack::Spawn(std::unique_ptr<Action> child, RuntimeScope scope)
|
||||
return Success();
|
||||
}
|
||||
|
||||
auto ActionStack::ReplaceWith(std::unique_ptr<Action> replacement)
|
||||
-> ErrorOr<Success> {
|
||||
std::unique_ptr<Action> old = todo_.Pop();
|
||||
CARBON_CHECK(replacement->kind() == old->kind())
|
||||
<< "ReplaceWith can't change action kind";
|
||||
todo_.Push(std::move(replacement));
|
||||
return Success();
|
||||
}
|
||||
|
||||
auto ActionStack::RunAgain() -> ErrorOr<Success> {
|
||||
Action& action = *todo_.Top();
|
||||
action.set_pos(action.pos() + 1);
|
||||
|
||||
Reference in new issue
Block a user