@@ -538,7 +538,7 @@ extension ParserTestCase {
538
538
applyFixIts: [ String ] ? = nil ,
539
539
fixedSource expectedFixedSource: String ? = nil ,
540
540
options: AssertParseOptions = [ ] ,
541
- experimentalFeatures: Parser . ExperimentalFeatures = [ ] ,
541
+ experimentalFeatures: Parser . ExperimentalFeatures ? = nil ,
542
542
file: StaticString = #file,
543
543
line: UInt = #line
544
544
) {
@@ -610,6 +610,8 @@ extension ParserTestCase {
610
610
/// - applyFixIts: Applies only the fix-its with these messages.
611
611
/// - fixedSource: Asserts that the source after applying fix-its matches
612
612
/// this string.
613
+ /// - experimentalFeatures: A list of experimental features to enable, or
614
+ /// `nil` to enable the default set of features provided by the test case.
613
615
func assertParse< S: SyntaxProtocol > (
614
616
_ markedSource: String ,
615
617
_ parse: ( inout Parser ) -> S ,
@@ -619,10 +621,12 @@ extension ParserTestCase {
619
621
applyFixIts: [ String ] ? = nil ,
620
622
fixedSource expectedFixedSource: String ? = nil ,
621
623
options: AssertParseOptions = [ ] ,
622
- experimentalFeatures: Parser . ExperimentalFeatures = [ ] ,
624
+ experimentalFeatures: Parser . ExperimentalFeatures ? = nil ,
623
625
file: StaticString = #file,
624
626
line: UInt = #line
625
627
) {
628
+ let experimentalFeatures = experimentalFeatures ?? self . experimentalFeatures
629
+
626
630
// Verify the parser can round-trip the source
627
631
var ( markerLocations, source) = extractMarkers ( markedSource)
628
632
markerLocations [ " START " ] = 0
0 commit comments