This commit is contained in:
Chris Wong 2015-03-15 16:42:34 +13:00
parent 333eb46c3a
commit 92020cfa86

View file

@ -236,22 +236,20 @@ impl<'cx, 's, 'i> Parser<'cx, 's, 'i> {
self.shift(1); self.shift(1);
tts.push(tt.clone()); tts.push(tt.clone());
} }
loop { loop { match self.input {
match self.input { // Munch attribute lookups e.g. `$person.address.street`
// Munch attribute lookups e.g. `$person.address.street` [ref dot @ dot!(), ref ident @ ident!(_), ..] => {
[ref dot @ dot!(), ref ident @ ident!(_), ..] => { self.shift(2);
self.shift(2); tts.push(dot.clone());
tts.push(dot.clone()); tts.push(ident.clone());
tts.push(ident.clone()); },
}, // Munch function calls `()` and indexing operations `[]`
// Munch function calls `()` and indexing operations `[]` [TtDelimited(sp, ref d), ..] if d.delim != token::DelimToken::Brace => {
[TtDelimited(sp, ref d), ..] if d.delim != token::DelimToken::Brace => { self.shift(1);
self.shift(1); tts.push(TtDelimited(sp, d.clone()));
tts.push(TtDelimited(sp, d.clone())); },
}, _ => break,
_ => break, }}
}
}
if tts.is_empty() { if tts.is_empty() {
self.render.cx.span_fatal(sp, "expected expression for this splice"); self.render.cx.span_fatal(sp, "expected expression for this splice");
} else { } else {