gccrs: proc_macro: Mirror FFIString changes in C++library

Recent changes in the rust interface on some extern C function shall be
synced up in the C++ library.

libgrust/ChangeLog:

	* libproc_macro/literal.cc (Literal__from_string):
	Update to match rust interface.
	* libproc_macro/literal.h (Literal__from_string):
	Likewise.
	* libproc_macro/tokenstream.cc (TokenStream__from_string):
	Likewise.
	* libproc_macro/tokenstream.h (TokenStream__from_string):
	Likewise.

Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
This commit is contained in:
Pierre-Emmanuel Patry 2023-07-26 15:39:25 +02:00 committed by Arthur Cohen
parent f00f3837ef
commit 973f4088ef
4 changed files with 7 additions and 8 deletions

View File

@ -28,7 +28,7 @@ namespace ProcMacro {
extern "C" {
bool
Literal__from_string (const unsigned char *str, std::uint64_t len, Literal *lit)
Literal__from_string (FFIString str, Literal *lit)
{
// FIXME: implement this function with lexer
std::abort ();

View File

@ -105,8 +105,7 @@ public:
extern "C" {
bool
Literal__from_string (const unsigned char *str, std::uint64_t len,
Literal *lit);
Literal__from_string (FFIString str, Literal *lit);
}
} // namespace ProcMacro

View File

@ -103,11 +103,10 @@ TokenSream__push (TokenStream *stream, TokenTree tree)
}
extern "C" bool
TokenStream__from_string (unsigned char *str, std::uint64_t len,
TokenStream *ts)
TokenStream__from_string (FFIString str, TokenStream *ts)
{
bool result;
auto source = std::string (reinterpret_cast<const char *> (str), len);
auto source = str.to_string ();
*ts = TokenStream::make_tokenstream (source, result);
return result;

View File

@ -27,6 +27,8 @@
#include <vector>
#include <string>
#include "ffistring.h"
namespace ProcMacro {
struct TokenTree;
@ -59,8 +61,7 @@ extern "C" void
TokenSream__push (TokenStream *stream, TokenTree tree);
extern "C" bool
TokenStream__from_string (unsigned char *str, std::uint64_t len,
TokenStream *ts);
TokenStream__from_string (FFIString str, TokenStream *ts);
extern "C" TokenStream
TokenStream__clone (const TokenStream *ts);