diff --git a/CHANGELOG.md b/CHANGELOG.md index ef10de4..b321c81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,8 +5,7 @@ - [Added] Iron 0.6 support [#107](https://github.com/lfairy/maud/pull/107) - [Fixed] Allow braces in the boolean expression for a toggled class -- [Fixed] Update to rustc 1.21.0-nightly (f25c2283b 2017-08-15) - [#99](https://github.com/lfairy/maud/issues/99) +- [Fixed] Update to rustc 1.23.0-nightly (6160040d8 2017-11-18) ## [0.17.1] - 2017-08-11 diff --git a/maud_macros/src/lib.rs b/maud_macros/src/lib.rs index 3e420de..1f6963a 100644 --- a/maud_macros/src/lib.rs +++ b/maud_macros/src/lib.rs @@ -29,7 +29,7 @@ pub fn html_debug(input: TokenStream) -> TokenStream { fn expand(input: TokenStream) -> TokenStream { let output_ident = TokenTree { kind: TokenNode::Term(Term::intern("__maud_output")), - span: Span::default(), + span: Span::def_site(), }; // Heuristic: the size of the resulting markup tends to correlate with the // code size of the template itself diff --git a/maud_macros/src/parse.rs b/maud_macros/src/parse.rs index 4299647..c9bdbdf 100644 --- a/maud_macros/src/parse.rs +++ b/maud_macros/src/parse.rs @@ -353,17 +353,21 @@ impl Parser { }, // $pat => $expr Some(first_token) => { + let mut span = first_token.span; let mut body = vec![first_token]; loop { match self.next() { Some(TokenTree { kind: TokenNode::Op(',', _), .. }) => break, Some(token) => { + if let Some(bigger_span) = span.join(token.span) { + span = bigger_span; + } body.push(token); }, None => return self.error("unexpected end of @match arm"), } } - self.block(body.into_iter().collect(), Span::default())? + self.block(body.into_iter().collect(), span)? }, None => return self.error("unexpected end of @match arm"), };