gccrs: libproc_macro: Put all structures in a namespace

Put all functions and structures in a Procmacro namespace to avoid
spilling names in any other namespace.

libgrust/ChangeLog:

	* libproc_macro/group.cc (Group::drop): Add Procmacro
	namespace.
	* libproc_macro/group.h: Likewise.
	* libproc_macro/ident.cc (Ident::drop): Likewise.
	* libproc_macro/ident.h (Ident__clone): Likewise.
	* libproc_macro/literal.cc (Literal::make_isize):
	Likewise.
	* libproc_macro/literal.h (Literal__from_string):
	Likewise.
	* libproc_macro/punct.cc (Punct::make_punct): Likewise.
	* libproc_macro/punct.h: Likewise.
	* libproc_macro/tokenstream.cc (TokenStream__drop):
	Likewise.
	* libproc_macro/tokenstream.h (TokenStream__drop):
	Likewise.
	* libproc_macro/tokentree.cc (TokenTree::drop):
	Likewise.
	* libproc_macro/tokentree.h: Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
This commit is contained in:
Pierre-Emmanuel Patry 2023-04-25 12:42:47 +02:00 committed by Arthur Cohen
parent 1ca5d5f84c
commit e112189800
12 changed files with 24 additions and 0 deletions

View File

@ -22,6 +22,7 @@
#include "group.h"
namespace ProcMacro {
namespace Group {
Group
@ -37,3 +38,4 @@ Group::drop (Group *g)
}
} // namespace Group
} // namespace ProcMacro

View File

@ -25,6 +25,7 @@
#include "tokenstream.h"
namespace ProcMacro {
namespace Group {
enum Delimiter
@ -47,5 +48,6 @@ public:
};
} // namespace Group
} // namespace ProcMacro
#endif /* ! GROUP_H */

View File

@ -23,6 +23,7 @@
#include <cstring>
namespace ProcMacro {
namespace Ident {
extern "C" {
@ -84,3 +85,4 @@ Ident::drop (Ident *ident)
}
} // namespace Ident
} // namespace ProcMacro

View File

@ -26,6 +26,7 @@
#include <cstdint>
#include <string>
namespace ProcMacro {
namespace Ident {
struct Ident
@ -61,5 +62,6 @@ Ident__clone (const Ident *ident);
}
} // namespace Ident
} // namespace ProcMacro
#endif /* ! IDENT_H */

View File

@ -24,6 +24,7 @@
#include <cstring>
#include <cstdlib>
namespace ProcMacro {
namespace Literal {
void
@ -289,3 +290,4 @@ Literal::make_isize (std::int64_t value, bool suffixed)
}
} // namespace Literal
} // namespace ProcMacro

View File

@ -27,6 +27,7 @@
#include <string>
#include <vector>
namespace ProcMacro {
namespace Literal {
enum UnsignedTag
{
@ -207,5 +208,6 @@ Literal__from_string (const unsigned char *str, std::uint64_t len,
Literal *lit);
}
} // namespace Literal
} // namespace ProcMacro
#endif /* ! LITERAL_H */

View File

@ -23,6 +23,7 @@
#include "punct.h"
#include <cstdlib>
namespace ProcMacro {
namespace Punct {
Punct
@ -32,3 +33,4 @@ Punct::make_punct (std::uint32_t ch, Spacing spacing)
}
} // namespace Punct
} // namespace ProcMacro

View File

@ -25,6 +25,7 @@
#include <cstdint>
namespace ProcMacro {
namespace Punct {
enum Spacing
@ -43,5 +44,6 @@ public:
};
} // namespace Punct
} // namespace ProcMacro
#endif /* ! PUNCT_H */

View File

@ -25,6 +25,7 @@
#include <cstring>
namespace ProcMacro {
namespace TokenStream {
TokenStream
@ -117,3 +118,4 @@ TokenStream__drop (TokenStream *stream)
}
} // namespace TokenStream
} // namespace ProcMacro

View File

@ -26,6 +26,7 @@
#include <cstdint>
#include <vector>
namespace ProcMacro {
namespace TokenTree {
struct TokenTree;
}
@ -73,5 +74,6 @@ extern "C" void
TokenStream__drop (TokenStream *stream);
} // namespace TokenStream
} // namespace ProcMacro
#endif /* ! TOKENSTREAM_H */

View File

@ -22,6 +22,7 @@
#include "tokentree.h"
namespace ProcMacro {
namespace TokenTree {
TokenTree
@ -76,3 +77,4 @@ TokenTree::drop (TokenTree *tt)
}
} // namespace TokenTree
} // namespace ProcMacro

View File

@ -28,6 +28,7 @@
#include "punct.h"
#include "literal.h"
namespace ProcMacro {
namespace TokenTree {
enum TokenTreeTag
@ -61,5 +62,6 @@ public:
};
} // namespace TokenTree
} // namespace ProcMacro
#endif /* ! TOKENTREE_H */