aboutsummaryrefslogtreecommitdiff
path: root/gcc/rust/ast/rust-macro.h
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2022-04-28 09:44:04 +0000
committerGitHub <noreply@github.com>2022-04-28 09:44:04 +0000
commit1ada076b9324982fd6f49aea6456e99613e394a8 (patch)
tree811ca2f61e351aeda8be3e5f2e94a93993c1881e /gcc/rust/ast/rust-macro.h
parentaf48e2a3a1554f727e83281cc96071d9b8b3ef91 (diff)
parent471cff253a1c67cf4a85c0a91695e7e6d7803a5e (diff)
downloadgcc-1ada076b9324982fd6f49aea6456e99613e394a8.zip
gcc-1ada076b9324982fd6f49aea6456e99613e394a8.tar.gz
gcc-1ada076b9324982fd6f49aea6456e99613e394a8.tar.bz2
Merge #1189
1189: Add missing `SimplePath`s location r=CohenArthur a=CohenArthur Sorry to new contributors but I think I've taken all the good first issues we opened yesterday... Closes #1179 Closes #1180 Closes #1181 Closes #1182 Necessary for #1172 Addresses #1159 Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
Diffstat (limited to 'gcc/rust/ast/rust-macro.h')
-rw-r--r--gcc/rust/ast/rust-macro.h30
1 files changed, 21 insertions, 9 deletions
diff --git a/gcc/rust/ast/rust-macro.h b/gcc/rust/ast/rust-macro.h
index 5ab82c4..1bf8912 100644
--- a/gcc/rust/ast/rust-macro.h
+++ b/gcc/rust/ast/rust-macro.h
@@ -759,9 +759,12 @@ protected:
class MetaWord : public MetaItem
{
Identifier ident;
+ Location ident_locus;
public:
- MetaWord (Identifier ident) : ident (std::move (ident)) {}
+ MetaWord (Identifier ident, Location ident_locus)
+ : ident (std::move (ident)), ident_locus (ident_locus)
+ {}
std::string as_string () const override { return ident; }
@@ -783,12 +786,17 @@ protected:
class MetaNameValueStr : public MetaItem
{
Identifier ident;
+ Location ident_locus;
+
// NOTE: str stored without quotes
std::string str;
+ Location str_locus;
public:
- MetaNameValueStr (Identifier ident, std::string str)
- : ident (std::move (ident)), str (std::move (str))
+ MetaNameValueStr (Identifier ident, Location ident_locus, std::string str,
+ Location str_locus)
+ : ident (std::move (ident)), ident_locus (ident_locus),
+ str (std::move (str)), str_locus (str_locus)
{}
std::string as_string () const override
@@ -821,11 +829,14 @@ protected:
class MetaListPaths : public MetaItem
{
Identifier ident;
+ Location ident_locus;
std::vector<SimplePath> paths;
public:
- MetaListPaths (Identifier ident, std::vector<SimplePath> paths)
- : ident (std::move (ident)), paths (std::move (paths))
+ MetaListPaths (Identifier ident, Location ident_locus,
+ std::vector<SimplePath> paths)
+ : ident (std::move (ident)), ident_locus (ident_locus),
+ paths (std::move (paths))
{}
std::string as_string () const override;
@@ -852,13 +863,14 @@ protected:
class MetaListNameValueStr : public MetaItem
{
Identifier ident;
+ Location ident_locus;
std::vector<MetaNameValueStr> strs;
- // FIXME add location info
-
public:
- MetaListNameValueStr (Identifier ident, std::vector<MetaNameValueStr> strs)
- : ident (std::move (ident)), strs (std::move (strs))
+ MetaListNameValueStr (Identifier ident, Location ident_locus,
+ std::vector<MetaNameValueStr> strs)
+ : ident (std::move (ident)), ident_locus (ident_locus),
+ strs (std::move (strs))
{}
std::string as_string () const override;