flagPlaceholderAsVisited method
Marks the given placeholder
as visited to detect circular references.
If the placeholder is already visited, throws a PlaceholderResolutionException.
Implementation
void flagPlaceholderAsVisited(String placeholder) {
visitedPlaceholders ??= <String>{};
if (!visitedPlaceholders!.add(placeholder)) {
throw PlaceholderResolutionException("Circular placeholder reference '%s'".formatted(placeholder), placeholder, null);
}
}