import org.simantics.scl.compiler.environment.Environment;
import org.simantics.scl.compiler.environment.EnvironmentFactory;
import org.simantics.scl.compiler.environment.Environments;
+import org.simantics.scl.compiler.errors.CompilationError;
import org.simantics.scl.compiler.errors.ErrorLog;
+import org.simantics.scl.compiler.errors.ErrorSeverity;
import org.simantics.scl.compiler.errors.Locations;
import org.simantics.scl.compiler.internal.codegen.effects.EffectConstructor;
import org.simantics.scl.compiler.internal.codegen.effects.ThreadLocalVariable;
compilationContext.environment = new EnvironmentOfModule(importedEnvironment, module);
} catch (ImportFailureException e) {
for(ImportFailure failure : e.failures)
- errorLog.log(failure.location, failure.toString());
+ errorLog.log(new CompilationError(failure.location, failure.toString(), ErrorSeverity.IMPORT_ERROR));
return;
}
for(ImportDeclaration importAst : importsAst)
dataTypes.add(dataType);
for(int j=0;j<constructors.length;++j) {
ConstructorAst constructor = dataTypeAst.constructors[j];
- String name = constructor.name;
+ String name = constructor.name.text;
Type[] parameterTypes = new Type[constructor.parameters.length];
for(int i=constructor.parameters.length-1;i>=0;--i)
parameterTypes[i] = context.toType(constructor.parameters[i]);
int constructorTag = 0;
for(Constructor constructor : dataType.constructors) {
SCLValue value = new SCLValue(constructor.name);
+ value.definitionLocation = constructor.loc;
SCLConstructor sclConstructor =
new SCLConstructor(
constructor.name.name,