mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-06 08:44:41 +01:00
Separate fields from other var decls in parse (#5320)
This enables us to decouple class fields from pattern matching. --------- Co-authored-by: josh11b <15258583+josh11b@users.noreply.github.com>
This commit is contained in:
@@ -436,7 +436,9 @@ auto Context::DiagnoseExpectedDeclSemiOrDefinition(Lex::TokenKind expected_kind)
|
||||
// definitions are deferred, such as a class or interface.
|
||||
static auto ParsingInDeferredDefinitionScope(Context& context) -> bool {
|
||||
auto& stack = context.state_stack();
|
||||
if (stack.size() < 2 || stack.back().kind != StateKind::DeclScopeLoop) {
|
||||
if (stack.size() < 2 ||
|
||||
(stack.back().kind != StateKind::DeclScopeLoopAsClass &&
|
||||
stack.back().kind != StateKind::DeclScopeLoopAsNonClass)) {
|
||||
return false;
|
||||
}
|
||||
auto kind = stack[stack.size() - 2].kind;
|
||||
|
||||
Reference in New Issue
Block a user