Skip to content

Commit fd4a093

Browse files
committed
jsondocck: Require command is at start of line
1 parent 49e5e4e commit fd4a093

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/tools/jsondocck/src/main.rs

+1
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ impl CommandKind {
154154
static LINE_PATTERN: LazyLock<Regex> = LazyLock::new(|| {
155155
RegexBuilder::new(
156156
r#"
157+
^\s*
157158
//@\s+
158159
(?P<negated>!?)
159160
(?P<cmd>[A-Za-z0-9]+(?:-[A-Za-z0-9]+)*)

tests/rustdoc-json/fns/return_type_alias.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Regression test for <https://github.com/rust-lang/rust/issues/104851>
22

3-
///@ set foo = "$.index[?(@.name=='Foo')].id"
3+
//@ set foo = "$.index[?(@.name=='Foo')].id"
44
pub type Foo = i32;
55

66
//@ is "$.index[?(@.name=='demo')].inner.function.sig.output.resolved_path.id" $foo

0 commit comments

Comments
 (0)