File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
Sources/SwiftOperatorPrecedence Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -444,6 +444,11 @@ extension OperatorPrecedence {
444
444
/// tree with structured syntax trees, by walking the tree and invoking
445
445
/// `foldSingle` on each sequence expression it encounters. Use this to
446
446
/// provide structure to an entire tree.
447
+ ///
448
+ /// Due to the inability to express the implementation of this rethrowing
449
+ /// function, a throwing error handler will end up being called twice with
450
+ /// the first error that causes it to be thrown. The first call will stop
451
+ /// the operation, then the second must also throw.
447
452
public func foldAll< Node: SyntaxProtocol > (
448
453
_ node: Node ,
449
454
errorHandler: OperatorPrecedenceErrorHandler = { throw $0 }
@@ -459,6 +464,7 @@ extension OperatorPrecedence {
459
464
// error.
460
465
if let origFatalError = folder. firstFatalError {
461
466
try errorHandler ( origFatalError)
467
+ fatalError ( " error handler did not throw again after \( origFatalError) " )
462
468
}
463
469
464
470
return result
You can’t perform that action at this time.
0 commit comments