(t *testing.T, options ...Option)
| 2653 | } |
| 2654 | |
| 2655 | func newTestParser(t *testing.T, options ...Option) *Parser { |
| 2656 | t.Helper() |
| 2657 | defaultOpts := []Option{ |
| 2658 | Macros(AllMacros...), |
| 2659 | MaxRecursionDepth(32), |
| 2660 | ErrorRecoveryLimit(4), |
| 2661 | ErrorRecoveryLookaheadTokenLimit(4), |
| 2662 | PopulateMacroCalls(true), |
| 2663 | } |
| 2664 | opts := append([]Option{}, defaultOpts...) |
| 2665 | opts = append(opts, options...) |
| 2666 | p, err := NewParser(opts...) |
| 2667 | if err != nil { |
| 2668 | t.Fatalf("NewParser() failed: %v", err) |
| 2669 | } |
| 2670 | return p |
| 2671 | } |
| 2672 | |
| 2673 | // RelativeSource represents an embedded source element within a larger source. |
| 2674 | type RelativeSource struct { |
no test coverage detected