(t *testing.T, options ...Option)
| 2392 | } |
| 2393 | |
| 2394 | func newTestParser(t *testing.T, options ...Option) *Parser { |
| 2395 | t.Helper() |
| 2396 | defaultOpts := []Option{ |
| 2397 | Macros(AllMacros...), |
| 2398 | MaxRecursionDepth(32), |
| 2399 | ErrorRecoveryLimit(4), |
| 2400 | ErrorRecoveryLookaheadTokenLimit(4), |
| 2401 | PopulateMacroCalls(true), |
| 2402 | } |
| 2403 | opts := append([]Option{}, defaultOpts...) |
| 2404 | opts = append(opts, options...) |
| 2405 | p, err := NewParser(opts...) |
| 2406 | if err != nil { |
| 2407 | t.Fatalf("NewParser() failed: %v", err) |
| 2408 | } |
| 2409 | return p |
| 2410 | } |
| 2411 | |
| 2412 | // RelativeSource represents an embedded source element within a larger source. |
| 2413 | type RelativeSource struct { |
no test coverage detected