Skip to content

Commit

Permalink
Parse - Hacky support for use crate as foo;
Browse files Browse the repository at this point in the history
  • Loading branch information
thepowersgang committed Sep 7, 2024
1 parent aa006e9 commit 27c8ed5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/parse/root.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,12 @@ void Parse_Use_Root(TokenStream& lex, ::std::vector<AST::UseItem::Ent>& entries)
GET_CHECK_TOK(tok, lex, TOK_DOUBLE_COLON);
break; }
case TOK_RWORD_CRATE:
if( lex.lookahead(0) == TOK_RWORD_AS ) {
GET_CHECK_TOK(tok, lex, TOK_RWORD_AS);
auto name = get_optional_ident(lex);
entries.push_back({ lex.point_span(), AST::Path(path), ::std::move(name) });
return;
}
// 1.29 absolute path
GET_CHECK_TOK(tok, lex, TOK_DOUBLE_COLON);
break;
Expand Down

0 comments on commit 27c8ed5

Please sign in to comment.