summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Hodge <tpg@mutabah.net>2016-09-20 17:17:09 +0800
committerJohn Hodge <tpg@mutabah.net>2016-09-20 17:17:09 +0800
commit917b4379ef224c68a084b17a10e6605be63db155 (patch)
tree15d2c5c0e5d73f563022f62a963bd078cdc0f14a
parentb589ef3e4437eb6eb5979240694499cec5a44f75 (diff)
downloadmrust-917b4379ef224c68a084b17a10e6605be63db155.tar.gz
Expand format_args! - (minor) Commenting and TODO to actually emit the fragments
-rw-r--r--src/expand/format_args.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/expand/format_args.cpp b/src/expand/format_args.cpp
index 7ac04dc5..3e74e076 100644
--- a/src/expand/format_args.cpp
+++ b/src/expand/format_args.cpp
@@ -307,9 +307,6 @@ class CFormatArgsExpander:
::std::vector<TokenTree> toks;
{
- // TODO: Figure out what path to use (::fmt, ::core::fmt, or ::std::fmt)
-
-
switch(crate.m_load_std)
{
case ::AST::Crate::LOAD_NONE:
@@ -323,15 +320,19 @@ class CFormatArgsExpander:
toks.push_back( Token(TOK_IDENT, "std") );
break;
}
+
+ // ::fmt::Arguments::new_v1
toks.push_back( TokenTree(TOK_DOUBLE_COLON) );
toks.push_back( Token(TOK_IDENT, "fmt") );
toks.push_back( TokenTree(TOK_DOUBLE_COLON) );
toks.push_back( Token(TOK_IDENT, "Arguments") );
toks.push_back( TokenTree(TOK_DOUBLE_COLON) );
toks.push_back( Token(TOK_IDENT, "new_v1") );
+ // (
toks.push_back( TokenTree(TOK_PAREN_OPEN) );
{
toks.push_back( TokenTree(TOK_AMP) );
+ // Raw string fragments
toks.push_back( TokenTree(TOK_SQUARE_OPEN) );
for(const auto& frag : fragments ) {
toks.push_back( Token(TOK_STRING, frag.leading_text) );
@@ -340,10 +341,13 @@ class CFormatArgsExpander:
toks.push_back( TokenTree(TOK_SQUARE_CLOSE) );
toks.push_back( TokenTree(TOK_COMMA) );
+ // TODO: Fragments to format
+ // - The format stored by mrustc doesn't quite work with how rustc (and fmt::rt::v1) works
toks.push_back( TokenTree(TOK_AMP) );
toks.push_back( TokenTree(TOK_SQUARE_OPEN) );
toks.push_back( TokenTree(TOK_SQUARE_CLOSE) );
}
+ // )
toks.push_back( TokenTree(TOK_PAREN_CLOSE) );
}