mirror of
https://github.com/peterdell/wudsn-ide.git
synced 2025-01-21 08:33:36 +00:00
Adapt naming of language annotation values parameters
This commit is contained in:
parent
9950c7a286
commit
24d6e2ed37
@ -115,8 +115,8 @@ public final class CompilerFiles {
|
||||
public final String symbolsFilePath;
|
||||
public final String symbolsFileName;
|
||||
|
||||
public CompilerFiles(IFile mainSourceIFile, LanguageAnnotationValues mainSourceFileLanguageProperties,
|
||||
IFile sourceIFile, LanguageAnnotationValues sourceFileLanguageProperties,
|
||||
public CompilerFiles(IFile mainSourceIFile, LanguageAnnotationValues mainSourceFileLanguageAnnotationValues,
|
||||
IFile sourceIFile, LanguageAnnotationValues sourceFileLanguageAnnotationValues,
|
||||
LanguageHardwareCompilerDefinitionPreferences languageHardwareCompilerDefinitionPreferences) {
|
||||
|
||||
if (mainSourceIFile == null) {
|
||||
@ -128,8 +128,8 @@ public final class CompilerFiles {
|
||||
if (languageHardwareCompilerDefinitionPreferences == null) {
|
||||
throw new IllegalArgumentException("Parameter 'compilerPreferences' must not be null.");
|
||||
}
|
||||
this.mainSourceFile = new SourceFile(mainSourceIFile, mainSourceFileLanguageProperties);
|
||||
this.sourceFile = new SourceFile(sourceIFile, sourceFileLanguageProperties);
|
||||
this.mainSourceFile = new SourceFile(mainSourceIFile, mainSourceFileLanguageAnnotationValues);
|
||||
this.sourceFile = new SourceFile(sourceIFile, sourceFileLanguageAnnotationValues);
|
||||
|
||||
// Output folder mode
|
||||
// Can be overridden via annotation value in main source file
|
||||
@ -138,10 +138,10 @@ public final class CompilerFiles {
|
||||
String localOutputFileExtension = languageHardwareCompilerDefinitionPreferences.getOutputFileExtension();
|
||||
|
||||
// Properties which override the preferences
|
||||
outputFolderModeAnnotationValue = mainSourceFileLanguageProperties.get(LanguageAnnotation.OUTPUT_FOLDER_MODE);
|
||||
outputFolderAnnotationValue = mainSourceFileLanguageProperties.get(LanguageAnnotation.OUTPUT_FOLDER);
|
||||
outputFileExtensionAnnotationValue = mainSourceFileLanguageProperties.get(LanguageAnnotation.OUTPUT_FILE_EXTENSION);
|
||||
outputFileAnnotationValue = mainSourceFileLanguageProperties.get(LanguageAnnotation.OUTPUT_FILE);
|
||||
outputFolderModeAnnotationValue = mainSourceFileLanguageAnnotationValues.get(LanguageAnnotation.OUTPUT_FOLDER_MODE);
|
||||
outputFolderAnnotationValue = mainSourceFileLanguageAnnotationValues.get(LanguageAnnotation.OUTPUT_FOLDER);
|
||||
outputFileExtensionAnnotationValue = mainSourceFileLanguageAnnotationValues.get(LanguageAnnotation.OUTPUT_FILE_EXTENSION);
|
||||
outputFileAnnotationValue = mainSourceFileLanguageAnnotationValues.get(LanguageAnnotation.OUTPUT_FILE);
|
||||
|
||||
// The following sequence sets the instance fields "outputFolder" and
|
||||
// "outputFileNameWithoutExtension" as well as the
|
||||
|
@ -47,7 +47,7 @@ import com.wudsn.ide.lng.compiler.CompilerOutputFolderMode;
|
||||
import com.wudsn.ide.lng.compiler.parser.CompilerSourceParser;
|
||||
|
||||
/**
|
||||
* Logic to handle the {@link CompilerFiles} of an {@link LanguageEditor}
|
||||
* Logic to handle the {@link CompilerFiles} of a {@link LanguageEditor}
|
||||
*
|
||||
* @author Peter Dell
|
||||
*
|
||||
@ -87,15 +87,12 @@ public final class LanguageEditorFilesLogic {
|
||||
if (sourceIFile != null) {
|
||||
|
||||
var document = languageEditor.getDocument();
|
||||
LanguageAnnotationValues annotationValues = CompilerSourceParser.getAnnotationValues(document);
|
||||
var sourceFileLanguageAnnotationValues = CompilerSourceParser.getAnnotationValues(document);
|
||||
|
||||
IFile mainSourceIFile;
|
||||
LanguageAnnotationValues mainSourceFileProperties;
|
||||
var mainSourceIFile = sourceIFile;
|
||||
var mainSourceFileLanguageAnnotationValues = sourceFileLanguageAnnotationValues;
|
||||
|
||||
mainSourceIFile = sourceIFile;
|
||||
mainSourceFileProperties = annotationValues;
|
||||
|
||||
LanguageAnnotationValue annotationValue = annotationValues.get(LanguageAnnotation.MAIN_SOURCE_FILE);
|
||||
LanguageAnnotationValue annotationValue = sourceFileLanguageAnnotationValues.get(LanguageAnnotation.MAIN_SOURCE_FILE);
|
||||
if (annotationValue != null) {
|
||||
if (StringUtility.isSpecified(annotationValue.value)) {
|
||||
IPath mainSourceFileIPath;
|
||||
@ -108,18 +105,18 @@ public final class LanguageEditorFilesLogic {
|
||||
|
||||
mainSource = FileUtility.readString(mainSourceFile, FileUtility.MAX_SIZE_UNLIMITED);
|
||||
document = new Document(mainSource);
|
||||
mainSourceFileProperties = CompilerSourceParser.getAnnotationValues(document);
|
||||
mainSourceFileLanguageAnnotationValues = CompilerSourceParser.getAnnotationValues(document);
|
||||
} catch (CoreException ex) {
|
||||
LanguagePlugin plugin = LanguagePlugin.getInstance();
|
||||
|
||||
plugin.logError("Cannot read main source file '{0'}", new Object[] { mainSourceFile.getPath() },
|
||||
ex);
|
||||
mainSourceFileProperties = new LanguageAnnotationValues();
|
||||
mainSourceFileLanguageAnnotationValues = new LanguageAnnotationValues();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
result = new CompilerFiles(mainSourceIFile, mainSourceFileProperties, sourceIFile, annotationValues,
|
||||
result = new CompilerFiles(mainSourceIFile, mainSourceFileLanguageAnnotationValues, sourceIFile, sourceFileLanguageAnnotationValues,
|
||||
languageEditor.getLanguageHardwareCompilerPreferences());
|
||||
} else {
|
||||
result = null;
|
||||
|
Loading…
x
Reference in New Issue
Block a user