-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
gccrs: use tl::optional for macro transcribers
refs #2421. gcc/rust/ChangeLog: * ast/rust-ast-fragment.cc (Fragment::create_empty): New. * ast/rust-ast-fragment.h (MacroTranscriberFunc): New. * ast/rust-macro.h (MacroRulesDefinition): Use MacroTranscriberFunc. * expand/rust-macro-builtins.cc (MacroBuiltin::builtin_transcribers): likewise. (MacroBuiltin::assert_handler): Return optional. (MacroBuiltin::file_handler): Likewise. (MacroBuiltin::column_handler): Likewise. (MacroBuiltin::include_bytes_handler): Likewise. (MacroBuiltin::include_str_handler): Likewise. (MacroBuiltin::compile_error_handler): Likewise. (MacroBuiltin::concat_handler): Likewise. (MacroBuiltin::env_handler): Likewise. (MacroBuiltin::cfg_handler): Likewise. (MacroBuiltin::include_handler): Likewise. (MacroBuiltin::line_handler): Likewise. (MacroBuiltin::stringify_handler): Likewise. (MacroBuiltin::sorry): Likewise. * expand/rust-macro-builtins.h (builtin_transcribers): Use MacroTranscriberFunc. (assert_handler): Return optional. (file_handler): Likewise. (column_handler): Likewise. (include_bytes_handler): Likewise. (include_str_handler): Likewise. (compile_error_handler): Likewise. (concat_handler): Likewise. (env_handler): Likewise. (cfg_handler): Likewise. (include_handler): Likewise. (line_handler): Likewise. (stringify_handler): Likewise. (sorry): Likewise. * expand/rust-macro-expand.cc (MacroExpander::expand_invoc): Adjust to transcribers returning optional. Signed-off-by: Marc Poulhiès <[email protected]>
- Loading branch information
Showing
6 changed files
with
70 additions
and
53 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters