And this block can combine with the previous one to become:

```rust
let message = if self.p.eof() {
    match self.stack[self.stack.len() - 1] {
        Key(_) => ~"..."
        Index(_) => ~"..."
    }
} else if self.stack.is_empty() {
    ~"..."
} else {
    ~"..."
};
self.error(message)
```

Or even
```rust
let message = match self.stack.last() {
    None => ~"trailing character", // EOF
    Some(&Key(_)) if self.p.eof() => ~"...",
    Some(&Index(_)) if self.p.eof() => ~"..."
    Some(_) => ~"invalid syntax"
};
self.error(message)
```