Source file test/fixedbugs/issue71680.go

     1  // compile
     2  
     3  // Copyright 2025 The Go Authors. All rights reserved.
     4  // Use of this source code is governed by a BSD-style
     5  // license that can be found in the LICENSE file.
     6  
     7  package p
     8  
     9  type Parser struct{}
    10  type Node struct{}
    11  
    12  type parserState func(p *Parser) parserState
    13  
    14  func parserStateData(root *Node) parserState {
    15  	return func(p *Parser) parserState {
    16  		return parserStateOpenMap(root)(p)
    17  	}
    18  }
    19  
    20  func parserStateOpenMap(root *Node) parserState {
    21  	return func(p *Parser) parserState {
    22  		switch {
    23  		case p != nil:
    24  			return parserStateData(root)(p)
    25  		}
    26  		return parserStateOpenMap(root)(p)
    27  	}
    28  }
    29  

View as plain text