summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
authorJohn Hodge <tpg@ucc.asn.au>2018-12-30 15:59:13 +0800
committerJohn Hodge <tpg@ucc.asn.au>2018-12-30 15:59:13 +0800
commit529c542631de917f45e25485be2dd778e34ba1ea (patch)
tree432afb50baa8384f13147de4587c06f91bb18273 /src/parse
parent48ea151b6fed48d96af12cbcc9137db49fcd5996 (diff)
downloadmrust-529c542631de917f45e25485be2dd778e34ba1ea.tar.gz
Parse - Handle `crate::` paths
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/paths.cpp2
-rw-r--r--src/parse/root.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/parse/paths.cpp b/src/parse/paths.cpp
index d103840e..26311d83 100644
--- a/src/parse/paths.cpp
+++ b/src/parse/paths.cpp
@@ -39,6 +39,8 @@ AST::Path Parse_Path(TokenStream& lex, eParsePathGenericMode generic_mode)
return AST::Path(AST::Path::TagSuper(), count, Parse_PathNodes(lex, generic_mode));
}
+ case TOK_RWORD_CRATE:
+ GET_CHECK_TOK(tok, lex, TOK_DOUBLE_COLON);
case TOK_DOUBLE_COLON:
return Parse_Path(lex, true, generic_mode);
diff --git a/src/parse/root.cpp b/src/parse/root.cpp
index 5fc90f0c..5eae2488 100644
--- a/src/parse/root.cpp
+++ b/src/parse/root.cpp
@@ -1396,6 +1396,8 @@ void Parse_Use(TokenStream& lex, ::std::function<void(AST::UseStmt, ::std::strin
case TOK_IDENT:
path.append( AST::PathNode(mv$(tok.str()), {}) );
break;
+ case TOK_RWORD_CRATE:
+ break;
// Leading :: is allowed and ignored for the $crate feature
case TOK_DOUBLE_COLON:
// Absolute path