mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 22:02:23 +01:00
Parse vars in classes the same as vars in other locations (#7188)
Class vars are still restricted to simple `name: type` bindings, not full patterns. This is now handled in the check phase instead of during parsing. This is in preparation for supporting `static var`.
This commit is contained in:
@@ -144,8 +144,8 @@ static constexpr auto DeclIntroducers = [] {
|
||||
StateKind::AssociatedConstant);
|
||||
set_contextual(Lex::TokenKind::Var, RegularContext,
|
||||
NodeKind::VariableIntroducer, StateKind::VarAsRegular);
|
||||
set_contextual(Lex::TokenKind::Var, ClassContext, NodeKind::FieldIntroducer,
|
||||
StateKind::FieldDecl);
|
||||
set_contextual(Lex::TokenKind::Var, ClassContext,
|
||||
NodeKind::VariableIntroducer, StateKind::VarAsRegular);
|
||||
|
||||
set(Lex::TokenKind::Inline, NodeKind::InlineIntroducer,
|
||||
StateKind::InlineDeclAfterIntroducer);
|
||||
|
||||
Reference in New Issue
Block a user