diff options
author | Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com> | 2023-07-11 14:41:33 +0200 |
---|---|---|
committer | Arthur Cohen <arthur.cohen@embecosm.com> | 2024-01-16 18:55:56 +0100 |
commit | bee12555414e19c9cbeaf3b7550f9f93e939e392 (patch) | |
tree | 8334b62cb040f36fdc0531744320d2c03493b34d /gcc/alloc-pool.cc | |
parent | dcba437a8223ca1a88a59e8286fb3565bd07b445 (diff) | |
download | gcc-bee12555414e19c9cbeaf3b7550f9f93e939e392.zip gcc-bee12555414e19c9cbeaf3b7550f9f93e939e392.tar.gz gcc-bee12555414e19c9cbeaf3b7550f9f93e939e392.tar.bz2 |
gccrs: proc_macro: Add from string implementation
Add a callback registration function into the proc macro library so the
compiler can register it's own lexing/parsing functions on load.
gcc/rust/ChangeLog:
* expand/rust-proc-macro.cc (tokenstream_from_string): Add a
function that creates a tokenstream from a given string.
(load_macros_array): Add call to registration function.
libgrust/ChangeLog:
* libproc_macro/proc_macro.cc (proc_macro_register_from_str):
Add registration function.
* libproc_macro/proc_macro.h (proc_macro_register_from_str):
Add registration function prototype.
* libproc_macro/tokenstream.cc (TokenStream::make_tokenstream):
Add a new constructor from a string that uses the registered
callback.
(TokenStream__from_string): Add call to new constructor.
* libproc_macro/tokenstream.h: Add registration
declaration.
* libproc_macro/registration.h: New file.
Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc/alloc-pool.cc')
0 files changed, 0 insertions, 0 deletions