syntax: Fix parsing of inherent traits

This commit is contained in:
Brian Anderson 2012-08-07 13:01:15 -07:00
parent 2772b2e5c7
commit 92ef17aaeb
2 changed files with 22 additions and 1 deletions

View file

@ -2436,7 +2436,8 @@ class parser {
!self.token_is_keyword(~"of", self.look_ahead(1)) &&
!self.token_is_keyword(~"for", self.look_ahead(1)) &&
self.look_ahead(1) != token::BINOP(token::SLASH) &&
self.look_ahead(1) != token::LT {
(self.look_ahead(1) != token::LT
|| (self.look_ahead(1) == token::LT && tps.is_not_empty())) {
// This is a new-style impl declaration.
ident = @~"__extensions__"; // XXX: clownshoes