diff --git a/maud/tests/warnings/element-missing-body.rs b/maud/tests/warnings/non-closed-element.rs similarity index 100% rename from maud/tests/warnings/element-missing-body.rs rename to maud/tests/warnings/non-closed-element.rs diff --git a/maud/tests/warnings/element-missing-body.stderr b/maud/tests/warnings/non-closed-element.stderr similarity index 70% rename from maud/tests/warnings/element-missing-body.stderr rename to maud/tests/warnings/non-closed-element.stderr index 8e9e813e..5f45772e 100644 --- a/maud/tests/warnings/element-missing-body.stderr +++ b/maud/tests/warnings/non-closed-element.stderr @@ -1,5 +1,5 @@ -error: unexpected end of input - --> $DIR/element-missing-body.rs:4:5 +error: expected `;`, found end of macro + --> $DIR/non-closed-element.rs:4:5 | 4 | / html! { 5 | | p diff --git a/maud_macros/src/parse.rs b/maud_macros/src/parse.rs index 86cd692a..bf78f2dd 100644 --- a/maud_macros/src/parse.rs +++ b/maud_macros/src/parse.rs @@ -542,7 +542,7 @@ impl Parser { semi_span: SpanRange::single_span(punct.span()), } } - _ => match self.markup() { + Some(_) => match self.markup() { ast::Markup::Block(block) => ast::ElementBody::Block { block }, markup => { let markup_span = markup.span(); @@ -553,6 +553,7 @@ impl Parser { ); } }, + None => abort_call_site!("expected `;`, found end of macro"), }; ast::Markup::Element { name, attrs, body } }