mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 19:51:09 +01:00
Start populating named entities in relevant locations. (#919)
This starts detecting naming collisions as a consequence of being able to determine when the name is declared twice in a given scope. Co-authored-by: Geoff Romer <gromer@google.com>
This commit is contained in:
committed by
GitHub
co-authored by
Geoff Romer
parent
82a870cfcd
commit
27e084d37a
@@ -108,7 +108,7 @@
|
||||
%type <Nonnull<Block*>> block
|
||||
%type <std::vector<Nonnull<Statement*>>> statement_list
|
||||
%type <Nonnull<Expression*>> expression
|
||||
%type <GenericBinding> generic_binding
|
||||
%type <BisonWrap<GenericBinding>> generic_binding
|
||||
%type <std::vector<GenericBinding>> deduced_params
|
||||
%type <std::vector<GenericBinding>> deduced_param_list
|
||||
%type <Nonnull<Pattern*>> pattern
|
||||
@@ -632,7 +632,7 @@ return_type:
|
||||
;
|
||||
generic_binding:
|
||||
identifier COLON_BANG expression
|
||||
{ $$ = GenericBinding({.name = std::move($1), .type = $3}); }
|
||||
{ $$ = GenericBinding(context.source_loc(), std::move($1), $3); }
|
||||
;
|
||||
deduced_param_list:
|
||||
// Empty
|
||||
@@ -696,11 +696,12 @@ member_list:
|
||||
;
|
||||
alternative:
|
||||
identifier tuple
|
||||
{ $$ = ChoiceDeclaration::Alternative($1, $2); }
|
||||
{ $$ = ChoiceDeclaration::Alternative(context.source_loc(), $1, $2); }
|
||||
| identifier
|
||||
{
|
||||
$$ = ChoiceDeclaration::Alternative(
|
||||
$1, arena->New<TupleLiteral>(context.source_loc()));
|
||||
context.source_loc(), $1,
|
||||
arena->New<TupleLiteral>(context.source_loc()));
|
||||
}
|
||||
;
|
||||
alternative_list:
|
||||
|
||||
Reference in New Issue
Block a user