(t *testing.T, options ...Option)
| 2410 | } |
| 2411 | |
| 2412 | func newTestParser(t *testing.T, options ...Option) *Parser { |
| 2413 | t.Helper() |
| 2414 | defaultOpts := []Option{ |
| 2415 | Macros(AllMacros...), |
| 2416 | MaxRecursionDepth(32), |
| 2417 | ErrorRecoveryLimit(4), |
| 2418 | ErrorRecoveryLookaheadTokenLimit(4), |
| 2419 | PopulateMacroCalls(true), |
| 2420 | } |
| 2421 | opts := append([]Option{}, defaultOpts...) |
| 2422 | opts = append(opts, options...) |
| 2423 | p, err := NewParser(opts...) |
| 2424 | if err != nil { |
| 2425 | t.Fatalf("NewParser() failed: %v", err) |
| 2426 | } |
| 2427 | return p |
| 2428 | } |
| 2429 | |
| 2430 | // RelativeSource represents an embedded source element within a larger source. |
| 2431 | type RelativeSource struct { |
no test coverage detected