Skip to content

Commit 50a1075

Browse files
authored
Merge pull request #2183 from ehuss/fix-cut-break
Fix formatting of markdown grammar with cut
2 parents a26605e + 2fb9e3c commit 50a1075

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/mdbook-spec/src/grammar/render_markdown.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ fn render_production(prod: &Production, cx: &RenderCtx, output: &mut String) {
6565
fn last_expr(expr: &Expression) -> &ExpressionKind {
6666
match &expr.kind {
6767
ExpressionKind::Alt(es) | ExpressionKind::Sequence(es) => last_expr(es.last().unwrap()),
68+
ExpressionKind::Cut(e) => last_expr(e),
6869
ExpressionKind::Grouped(_)
6970
| ExpressionKind::Optional(_)
7071
| ExpressionKind::NegativeLookahead(_)
@@ -79,7 +80,6 @@ fn last_expr(expr: &Expression) -> &ExpressionKind {
7980
| ExpressionKind::Comment(_)
8081
| ExpressionKind::Charset(_)
8182
| ExpressionKind::NegExpression(_)
82-
| ExpressionKind::Cut(_)
8383
| ExpressionKind::Unicode(_) => &expr.kind,
8484
}
8585
}

0 commit comments

Comments
 (0)