(start: number)
| 927 | exprOps.length > maxAllowed |
| 928 | ) |
| 929 | return null; |
| 930 | |
| 931 | // Sort anchors by specificity (most specific first) |
| 932 | // This reduces backtracking by pruning impossible branches early |
| 933 | const sortedAnchors = [...anchors].sort( |
| 934 | (a, b) => anchorSpecificity(b) - anchorSpecificity(a) |
| 935 | ); |
| 936 | |
| 937 | // Try to match anchors against expression elements using backtracking |
| 938 | return tryMatchAnchors(0, exprOps, substitution); |
| 939 | |
| 940 | function tryMatchAnchors( |
| 941 | anchorIndex: number, |
| 942 | remainingOps: Expression[], |
| 943 | sub: BoxedSubstitution |
no outgoing calls
no test coverage detected