rust-lang/rust — pull request #18229 by bjz (2014-10-22 12:00:24+00:00)
Title: Add Span and separate open/close delims to TTDelim

This came up when working [on the gl-rs generator extension](https://github.com/bjz/gl-rs/blob/990383de801bd2e233159d5be07c9b5622827620/src/gl_generator/lib.rs#L135-L146).

The new definition of `TTDelim` adds an associated `Span` that covers the whole token tree and enforces the invariant that a delimetered sequence of token trees must have an opening and closing delimeter.

A `get_span` method has also been added to `TokenTree` type to make it easier to implement better error messages for syntax extensions.