Skip to content

Commit b703b6c

Browse files
committed
Add a ? in the Children section for optional collections
Potentially, this is why I didn’t think about the fact that syntax collections can be optional.
1 parent 91b4481 commit b703b6c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

CodeGeneration/Sources/SyntaxSupport/GrammarGenerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct GrammarGenerator {
3737
let choicesDescriptions = choices.map { grammar(for: $0) }
3838
return "(\(choicesDescriptions.joined(separator: " | ")))\(optionality)"
3939
case .collection(kind: let kind, _, _, _):
40-
return "``\(kind.syntaxType)``"
40+
return "``\(kind.syntaxType)``\(optionality)"
4141
case .token(let choices, _, _):
4242
if choices.count == 1 {
4343
return "\(grammar(for: choices.first!))\(optionality)"

0 commit comments

Comments
 (0)