X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=bundles%2Forg.simantics.scl.compiler%2Fsrc%2Forg%2Fsimantics%2Fscl%2Fcompiler%2Finternal%2Fheader%2FModuleHeader.java;h=33a88ffba83dee70893e841c6cb516407ebca6fb;hb=54d006ab85f96d5016276be8edb52dc3e35efc0c;hp=7fec8f83ce0e3abe13b2b0fadbec83290cf5a8ba;hpb=c3945d04f5f0cff02b6d33d92d78325f53f121fa;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/header/ModuleHeader.java b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/header/ModuleHeader.java index 7fec8f83c..33a88ffba 100644 --- a/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/header/ModuleHeader.java +++ b/bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/internal/header/ModuleHeader.java @@ -1,5 +1,8 @@ package org.simantics.scl.compiler.internal.header; +import java.util.List; + +import org.simantics.scl.compiler.elaboration.expressions.EVar; import org.simantics.scl.compiler.elaboration.expressions.annotations.AnnotationUtils; import org.simantics.scl.compiler.elaboration.expressions.records.FieldAssignment; import org.simantics.scl.compiler.errors.ErrorLog; @@ -9,6 +12,8 @@ public class ModuleHeader { public String classLoader; public long classLoaderLocation; public String defaultLocalName; + public boolean fields; + public List export; private void read(ErrorLog errorLog, DModuleHeader header) { for(FieldAssignment assignment : header.fields) @@ -24,6 +29,15 @@ public class ModuleHeader { classLoaderLocation = assignment.location; } break; + case "export": + if(assignment.value == null) + errorLog.log(assignment.location, "Property export needs to be given a string list value."); + else { + export = AnnotationUtils.extractIdentifierList(assignment.value); + if(export == null) + errorLog.log(assignment.value.location, "Expected a list of exported items."); + } + break; case "defaultLocalName": if(assignment.value == null) errorLog.log(assignment.location, "Property defaultLocalName needs to be given a string value."); @@ -33,6 +47,11 @@ public class ModuleHeader { errorLog.log(assignment.value.location, "Expected string here."); } break; + case "fields": + if(assignment.value != null) + errorLog.log(assignment.location, "No value expected for property fields."); + this.fields = true; + break; default: errorLog.logWarning(assignment.location, "Unknown module header field was skipped."); }