implements PR022
This commit is contained in:
+8
-2
@@ -6,6 +6,7 @@ import p.studio.compiler.messages.FrontendPhaseContext;
|
||||
import p.studio.compiler.models.IRBackend;
|
||||
import p.studio.compiler.models.ProjectDescriptor;
|
||||
import p.studio.compiler.models.SourceHandle;
|
||||
import p.studio.compiler.models.SourceKind;
|
||||
import p.studio.compiler.pbs.PbsFrontendCompiler;
|
||||
import p.studio.compiler.pbs.ast.PbsAst;
|
||||
import p.studio.compiler.pbs.lexer.PbsLexer;
|
||||
@@ -48,6 +49,7 @@ public class PBSFrontendPhaseService implements FrontendPhaseService {
|
||||
|
||||
for (final var pId : ctx.stack.reverseTopologicalOrder) {
|
||||
final var projectDescriptor = ctx.projectTable.get(pId);
|
||||
final var projectSourceKind = ctx.sourceKind(pId);
|
||||
final var fileIds = ctx.fileTable.getFiles(pId);
|
||||
|
||||
for (final var fId : fileIds) {
|
||||
@@ -65,7 +67,7 @@ public class PBSFrontendPhaseService implements FrontendPhaseService {
|
||||
final var parseErrorBaseline = diagnostics.errorCount();
|
||||
final var ast = parseSourceFile(fId, utf8Content, diagnostics);
|
||||
moduleUnit.sources.add(new PbsModuleVisibilityValidator.SourceFile(fId, ast));
|
||||
parsedSourceFiles.add(new ParsedSourceFile(fId, ast, moduleKey));
|
||||
parsedSourceFiles.add(new ParsedSourceFile(fId, ast, moduleKey, projectSourceKind));
|
||||
if (diagnostics.errorCount() > parseErrorBaseline) {
|
||||
failedModuleKeys.add(moduleKey);
|
||||
}
|
||||
@@ -114,6 +116,9 @@ public class PBSFrontendPhaseService implements FrontendPhaseService {
|
||||
continue;
|
||||
}
|
||||
final var irBackendFile = frontendCompiler.compileParsedFile(parsedSource.fileId(), parsedSource.ast(), diagnostics);
|
||||
if (parsedSource.sourceKind() == SourceKind.SDK_INTERFACE) {
|
||||
continue;
|
||||
}
|
||||
irBackendAggregator.merge(irBackendFile);
|
||||
}
|
||||
|
||||
@@ -197,6 +202,7 @@ public class PBSFrontendPhaseService implements FrontendPhaseService {
|
||||
private record ParsedSourceFile(
|
||||
FileId fileId,
|
||||
PbsAst.File ast,
|
||||
String moduleKey) {
|
||||
String moduleKey,
|
||||
SourceKind sourceKind) {
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user