File tree Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Expand file tree Collapse file tree 3 files changed +10
-8
lines changed Original file line number Diff line number Diff line change 1
- Root <- skip ContainerMembers eof
1
+ Root <- skip container_doc_comment? ContainerMembers eof
2
2
3
3
# *** Top level ***
4
4
ContainerMembers
5
- <- container_doc_comment? (
5
+ <- (
6
6
TestDecl ContainerMembers
7
7
/ TopLevelComptime ContainerMembers
8
8
/ doc_comment? KEYWORD_pub? TopLevelDecl ContainerMembers
@@ -306,7 +306,7 @@ PtrTypeStart
306
306
/ LBRACKET ASTERISK (LETTERC / COLON Expr)? RBRACKET
307
307
308
308
# ContainerDecl specific
309
- ContainerDeclAuto <- ContainerDeclType LBRACE ContainerMembers RBRACE
309
+ ContainerDeclAuto <- ContainerDeclType LBRACE container_doc_comment? ContainerMembers RBRACE
310
310
311
311
ContainerDeclType
312
312
<- KEYWORD_struct
Original file line number Diff line number Diff line change @@ -10,8 +10,6 @@ const MyStruct = struct {
10
10
/// This is another doc comment
11
11
b : i32 ,
12
12
13
- //! Resuming container doc comment
14
-
15
13
/// And one more field
16
14
c : f32 ,
17
15
};
@@ -22,12 +20,10 @@ const MyEnum = enum {
22
20
23
21
/// This is Foo
24
22
Foo ,
25
- //! It has some other fields
26
23
/// This is Bar
27
24
Bar ,
28
25
};
29
26
30
- //! This is a container doc comment outside an error block
31
27
/// This is a doc comment for the error block
32
28
const Errors = error {
33
29
/// This documents MyError1
@@ -55,7 +51,6 @@ comptime {
55
51
const foo = add (40 , 2 );
56
52
}
57
53
58
- //! This is container doc comment
59
54
/// This is a doc comment for a test
60
55
test "This is my test" {
61
56
}
Original file line number Diff line number Diff line change
1
+ //! This is a valid container doc comment
2
+
3
+ const Foo = struct {
4
+ //! This is a valid container doc comment
5
+ };
6
+
7
+ //! This is an invalid container doc comment
You can’t perform that action at this time.
0 commit comments