(t *testing.T, options ...Option)
| 3923 | } |
| 3924 | |
| 3925 | func newTestParser(t *testing.T, options ...Option) *Parser { |
| 3926 | t.Helper() |
| 3927 | defaultOpts := []Option{ |
| 3928 | Macros(AllMacros...), |
| 3929 | MaxRecursionDepth(32), |
| 3930 | ErrorRecoveryLimit(4), |
| 3931 | ErrorRecoveryLookaheadTokenLimit(4), |
| 3932 | PopulateMacroCalls(true), |
| 3933 | } |
| 3934 | opts := append([]Option{}, defaultOpts...) |
| 3935 | opts = append(opts, options...) |
| 3936 | p, err := NewParser(opts...) |
| 3937 | if err != nil { |
| 3938 | t.Fatalf("NewParser() failed: %v", err) |
| 3939 | } |
| 3940 | return p |
| 3941 | } |
| 3942 | |
| 3943 | // RelativeSource represents an embedded source element within a larger source. |
| 3944 | type RelativeSource struct { |
no test coverage detected