mirror of
https://github.com/ziglang/zig.git
synced 2025-02-10 06:30:18 +00:00
Grammar: Use ContainerDeclaration*
instead of ContainerDeclarations
`ContainerDeclarations` is an abstraction of `ContainerDeclaration*`. Removing this abstraction allows the `ContainerMembers` rule to contain more concrete information without having to look at the definition of `ContainerDeclarations`.
This commit is contained in:
parent
9e341a6da3
commit
3a47bc7154
@ -12371,9 +12371,9 @@ fn readU32Be() u32 {}
|
||||
Root <- skip container_doc_comment? ContainerMembers eof
|
||||
|
||||
# *** Top level ***
|
||||
ContainerMembers <- ContainerDeclarations (ContainerField COMMA)* (ContainerField / ContainerDeclarations)
|
||||
ContainerMembers <- ContainerDeclaration* (ContainerField COMMA)* (ContainerField / ContainerDeclaration*)
|
||||
|
||||
ContainerDeclarations <- (TestDecl / ComptimeDecl / doc_comment? KEYWORD_pub? Decl)*
|
||||
ContainerDeclaration <- TestDecl / ComptimeDecl / doc_comment? KEYWORD_pub? Decl
|
||||
|
||||
TestDecl <- KEYWORD_test (STRINGLITERALSINGLE / IDENTIFIER)? Block
|
||||
|
||||
|
@ -205,9 +205,9 @@ pub fn parseZon(p: *Parse) !void {
|
||||
};
|
||||
}
|
||||
|
||||
/// ContainerMembers <- ContainerDeclarations (ContainerField COMMA)* (ContainerField / ContainerDeclarations)
|
||||
/// ContainerMembers <- ContainerDeclaration* (ContainerField COMMA)* (ContainerField / ContainerDeclaration*)
|
||||
///
|
||||
/// ContainerDeclarations <- (TestDecl / ComptimeDecl / doc_comment? KEYWORD_pub? Decl)*
|
||||
/// ContainerDeclaration <- TestDecl / ComptimeDecl / doc_comment? KEYWORD_pub? Decl
|
||||
///
|
||||
/// ComptimeDecl <- KEYWORD_comptime Block
|
||||
fn parseContainerMembers(p: *Parse) !Members {
|
||||
|
Loading…
Reference in New Issue
Block a user