File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -947,7 +947,24 @@ tl::optional<AST::Fragment>
947
947
MacroBuiltin::format_args_handler (location_t invoc_locus,
948
948
AST::MacroInvocData &invoc)
949
949
{
950
- Fmt::Pieces::collect (" heyo this {is} what I {} want to {3}, {parse}" );
950
+ auto fmt_expr
951
+ = parse_single_string_literal (BuiltinMacro::FormatArgs,
952
+ invoc.get_delim_tok_tree (), invoc_locus,
953
+ invoc.get_expander ());
954
+
955
+ if (!fmt_expr)
956
+ return AST::Fragment::create_error ();
957
+
958
+ // if it is not a literal, it's an eager macro invocation - return it
959
+ if (!fmt_expr->is_literal ())
960
+ {
961
+ auto token_tree = invoc.get_delim_tok_tree ();
962
+ return AST::Fragment ({AST::SingleASTNode (std::move (fmt_expr))},
963
+ token_tree.to_token_stream ());
964
+ }
965
+
966
+ auto format_string = fmt_expr->as_string ();
967
+ auto pieces = Fmt::Pieces::collect (format_string);
951
968
952
969
return AST::Fragment::create_empty ();
953
970
}
You can’t perform that action at this time.
0 commit comments