diff options
author | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-18 12:56:30 +0800 |
---|---|---|
committer | John Hodge (sonata) <tpg@mutabah.net> | 2015-01-18 12:56:30 +0800 |
commit | ba61031285402285e88a16f3788c20f455acc8e3 (patch) | |
tree | 8407f6ea4cbe1e5a2aed163ef5a4ebb22b5ddad4 /src/parse/root.cpp | |
parent | 0390dc8a92c3c8d12421d529915ab350234301c3 (diff) | |
download | mrust-ba61031285402285e88a16f3788c20f455acc8e3.tar.gz |
Added support for associated types in impl blocks
Diffstat (limited to 'src/parse/root.cpp')
-rw-r--r-- | src/parse/root.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/parse/root.cpp b/src/parse/root.cpp index 2c0acd4e..1ab010bd 100644 --- a/src/parse/root.cpp +++ b/src/parse/root.cpp @@ -640,6 +640,13 @@ AST::Impl Parse_Impl(TokenStream& lex) }
switch(tok.type())
{
+ case TOK_RWORD_TYPE: {
+ GET_CHECK_TOK(tok, lex, TOK_IDENT);
+ ::std::string name = tok.str();
+ GET_CHECK_TOK(tok, lex, TOK_EQUAL);
+ impl.add_type(is_public, name, Parse_Type(lex));
+ GET_CHECK_TOK(tok, lex, TOK_SEMICOLON);
+ break; }
case TOK_RWORD_FN: {
GET_CHECK_TOK(tok, lex, TOK_IDENT);
::std::string name = tok.str();
|