@@ -4118,14 +4118,14 @@ AttributeParser::parse_meta_item_inner ()
4118
4118
return parse_path_meta_item ();
4119
4119
}
4120
4120
4121
- auto &identifier = peek_token ();
4121
+ auto ident = peek_token ()->as_string ();
4122
+ auto ident_locus = peek_token ()->get_locus ();
4123
+
4122
4124
if (is_end_meta_item_tok (peek_token (1 )->get_id ()))
4123
4125
{
4124
4126
// meta word syntax
4125
4127
skip_token ();
4126
- // FIXME: We probably need a Location here as well
4127
- return std::unique_ptr<MetaWord> (
4128
- new MetaWord (identifier->as_string (), identifier->get_locus ()));
4128
+ return std::unique_ptr<MetaWord> (new MetaWord (ident, ident_locus));
4129
4129
}
4130
4130
4131
4131
if (peek_token (1 )->get_id () == EQUAL)
@@ -4145,9 +4145,8 @@ AttributeParser::parse_meta_item_inner ()
4145
4145
std::string raw_value = unquote_string (std::move (value));
4146
4146
4147
4147
return std::unique_ptr<MetaNameValueStr> (
4148
- new MetaNameValueStr (identifier->as_string (),
4149
- identifier->get_locus (),
4150
- std::move (raw_value), locus));
4148
+ new MetaNameValueStr (ident, ident_locus, std::move (raw_value),
4149
+ locus));
4151
4150
}
4152
4151
else
4153
4152
{
@@ -4189,7 +4188,7 @@ AttributeParser::parse_meta_item_inner ()
4189
4188
if (!meta_name_value_str_items.empty ())
4190
4189
{
4191
4190
return std::unique_ptr<MetaListNameValueStr> (
4192
- new MetaListNameValueStr (identifier-> as_string () ,
4191
+ new MetaListNameValueStr (ident, ident_locus ,
4193
4192
std::move (meta_name_value_str_items)));
4194
4193
}
4195
4194
@@ -4228,7 +4227,7 @@ AttributeParser::parse_meta_item_inner ()
4228
4227
if (!path_items.empty ())
4229
4228
{
4230
4229
return std::unique_ptr<MetaListPaths> (
4231
- new MetaListPaths (identifier-> as_string () , std::move (path_items)));
4230
+ new MetaListPaths (ident, ident_locus , std::move (path_items)));
4232
4231
}
4233
4232
4234
4233
rust_error_at (Linemap::unknown_location (),
@@ -4749,8 +4748,7 @@ MetaListPaths::to_attribute () const
4749
4748
4750
4749
std::unique_ptr<AttrInputMetaItemContainer> new_seq_container (
4751
4750
new AttrInputMetaItemContainer (std::move (new_seq)));
4752
- // FIXME: How do we get a location here?
4753
- return Attribute (SimplePath::from_str (ident, Location ()),
4751
+ return Attribute (SimplePath::from_str (ident, ident_locus),
4754
4752
std::move (new_seq_container));
4755
4753
}
4756
4754
@@ -4765,8 +4763,7 @@ MetaListNameValueStr::to_attribute () const
4765
4763
4766
4764
std::unique_ptr<AttrInputMetaItemContainer> new_seq_container (
4767
4765
new AttrInputMetaItemContainer (std::move (new_seq)));
4768
- // FIXME: How do we get a location here?
4769
- return Attribute (SimplePath::from_str (ident, Location ()),
4766
+ return Attribute (SimplePath::from_str (ident, ident_locus),
4770
4767
std::move (new_seq_container));
4771
4768
}
4772
4769
0 commit comments