Skip to content

Commit 3778580

Browse files
committed
Fix names collector
The new `@root` syntax needs to be accounted here.
1 parent bb5862e commit 3778580

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mdbook-spec/src/grammar.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ impl Expression {
136136
static GRAMMAR_RE: LazyLock<Regex> =
137137
LazyLock::new(|| Regex::new(r"(?ms)^```grammar,([^\n]+)\n(.*?)^```").unwrap());
138138
static NAMES_RE: LazyLock<Regex> =
139-
LazyLock::new(|| Regex::new(r"(?m)^([A-Za-z0-9_]+)(?: \([^)]+\))? ->").unwrap());
139+
LazyLock::new(|| Regex::new(r"(?m)^(?:@root )?([A-Za-z0-9_]+)(?: \([^)]+\))? ->").unwrap());
140140

141141
/// Loads the [`Grammar`] from the book.
142142
pub fn load_grammar(book: &Book, diag: &mut Diagnostics) -> Grammar {

0 commit comments

Comments
 (0)