Skip to content

Commit

Permalink
small fix in JS event.toString + NotEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
brice-morin committed Apr 12, 2021
1 parent bf2dd98 commit cc6c850
Show file tree
Hide file tree
Showing 3 changed files with 349 additions and 342 deletions.
Expand Up @@ -98,11 +98,10 @@ public boolean compile(Configuration cfg, Logger log, String... options) {
//Saving the complete model, e.g. to get all required inputs if there is a problem in the compiler
ThingMLModel flatModel = ThingMLHelpers.flattenModel(ThingMLHelpers.findContainingModel(cfg));
try {
saveAsThingML(flatModel, new File(ctx.getOutputDirectory(), cfg.getName() + "_merged.thingml").getAbsolutePath());
saveAsThingML(flatModel, new File(ctx.getOutputDirectory(), cfg.getName() + "_merged.thingml").getAbsolutePath());
} catch (Exception e) {
e.printStackTrace();
System.err.println("Could not save merged ThingML file!");
}
//saveAsXMI(flatModel, new File(ctx.getOutputDirectory(), cfg.getName() + "_merged.xmi").getAbsolutePath());

//Run validation
log.info("Checking configuration...");
Expand Down
Expand Up @@ -84,15 +84,15 @@ protected void generateEvents(Configuration cfg) {
for(Parameter p : m.getParameters()) {
events.append(" this." + p.getName() + " = params[" + m.getParameters().indexOf(p) + "];\n");
if (m.getParameters().indexOf(p) > 0)
params.append(" + ', ' + ");
params.append("this." + p.getName());
params.append(", ");
params.append("' + this." + p.getName() + " + '");
}
events.append(" }\n\n");
events.append(" " + className + ".prototype.is = function (type) {\n");
events.append(" return this.type === type;\n");
events.append(" };\n\n");
events.append(" " + className + ".prototype.toString = function () {\n");
events.append(" return 'event ' + this.type + '?' + this.port + '(' + " + params + " + ')';\n");
events.append(" return 'event ' + this.type + '?' + this.port + '(" + params + ")';\n");
events.append(" };\n\n");
events.append(" return " + className + ";\n");
events.append("}());\n");
Expand Down

0 comments on commit cc6c850

Please sign in to comment.