implements PLN-0105
This commit is contained in:
+7
-5
@@ -3,7 +3,6 @@ package p.studio.compiler;
|
||||
import p.studio.compiler.models.FrontendSpec;
|
||||
import p.studio.compiler.services.FrontendPhaseService;
|
||||
import p.studio.compiler.services.FrontendProvider;
|
||||
import p.studio.compiler.services.PBSFrontendPhaseService;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
@@ -14,7 +13,11 @@ public class FrontendRegistryService {
|
||||
private static final Map<String, FrontendProvider> FRONTEND_PROVIDERS = new HashMap<>();
|
||||
|
||||
static {
|
||||
register(new StaticFrontendProvider(PBSDefinitions.PBS, new PBSFrontendPhaseService()));
|
||||
bootstrapDefaults();
|
||||
}
|
||||
|
||||
public static void bootstrapDefaults() {
|
||||
registerIfAbsent(new PBSFrontendProvider());
|
||||
}
|
||||
|
||||
public static FrontendSpec getDefaultFrontendSpec() {
|
||||
@@ -64,8 +67,7 @@ public class FrontendRegistryService {
|
||||
FRONTEND_PROVIDERS.put(languageId, provider);
|
||||
}
|
||||
|
||||
private record StaticFrontendProvider(
|
||||
FrontendSpec specification,
|
||||
FrontendPhaseService compiler) implements FrontendProvider {
|
||||
private static void registerIfAbsent(final FrontendProvider provider) {
|
||||
FRONTEND_PROVIDERS.putIfAbsent(provider.specification().getLanguageId(), provider);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user