summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2017-08-27 18:46:05 +0800
committerJohn Hodge <tpg@ucc.asn.au>2017-08-27 18:46:05 +0800
commit2252c2dcc48ff33b973e4a2f95d3ee961401df2e (patch)
tree79fa080ce651ba2244c21799bd81fc0cc4f876d9 /src/parse
parent1a1975dd129f00f94c67bf6d1a0b14b3a36c5471 (diff)
downloadmrust-2252c2dcc48ff33b973e4a2f95d3ee961401df2e.tar.gz
Parse - A few little tweaks
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/expr.cpp3
-rw-r--r--src/parse/root.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/src/parse/expr.cpp b/src/parse/expr.cpp
index e0529155..f074bc3a 100644
--- a/src/parse/expr.cpp
+++ b/src/parse/expr.cpp
@@ -1009,12 +1009,13 @@ ExprNodeP Parse_ExprVal_StructLiteral(TokenStream& lex, AST::Path path)
GET_TOK(tok, lex);
}
CHECK_TOK(tok, TOK_IDENT);
+ auto h = lex.getHygiene();
auto name = mv$(tok.str());
ExprNodeP val;
if( lex.lookahead(0) != TOK_COLON )
{
- val = NEWNODE( AST::ExprNode_NamedValue, ::AST::Path(name) );
+ val = NEWNODE( AST::ExprNode_NamedValue, ::AST::Path(::AST::Path::TagRelative{}, h, { ::AST::PathNode(name) }) );
}
else
{
diff --git a/src/parse/root.cpp b/src/parse/root.cpp
index 33087724..85d51ddb 100644
--- a/src/parse/root.cpp
+++ b/src/parse/root.cpp
@@ -1376,6 +1376,9 @@ void Parse_Use(TokenStream& lex, ::std::function<void(AST::UseStmt, ::std::strin
Parse_Use_Set(lex, span_start, path, fcn);
GET_CHECK_TOK(tok, lex, TOK_BRACE_CLOSE);
return;
+ case TOK_INTERPOLATED_PATH:
+ path = mv$(tok.frag_path());
+ break;
default:
throw ParseError::Unexpected(lex, tok);
}