mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-11-16 04:18:15 +00:00
Support for returned var and return var. (#3374)
Implement toolchain support for `returned var` and `return var`.
- Modeled `returned` in the parse tree as a `ReturnedSpecifier`
appearing after the `VariableIntroducer`.
- Modeled `return var` in the parse tree as a `ReturnVarSpecifier`
appearing after the `ReturnStatementStart`.
- Factored out the implementation of `return` statement and `returned
var` handling in check into a new `return.{h,cpp}`. The parse nodes
themselves are still handled in `handle_*.cpp`. This allows easy code
reuse between `return` and `returned var`.
This commit is contained in:
1 parent
5020fdb3be
commit
afd6d85610
34 files changed
+1077
-146
No files matched your search
@@ -78,7 +78,7 @@ auto HandleDeclScopeLoop(Context& context) -> void {
|
||||
break;
|
||||
}
|
||||
case Lex::TokenKind::Var: {
|
||||
context.PushState(State::VarAsSemicolon);
|
||||
context.PushState(State::VarAsDecl);
|
||||
break;
|
||||
}
|
||||
case Lex::TokenKind::Let: {
|
||||
|
||||
Reference in new issue
Block a user