/**
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * See the NOTICE file distributed with this work for additional
 * information regarding copyright ownership.
 */
package org.thingml.compilers.javascript.node;

import org.thingml.compilers.Context;
import org.thingml.compilers.javascript.JSThingActionCompiler;
import org.thingml.xtext.thingML.ErrorAction;
import org.thingml.xtext.thingML.Expression;
import org.thingml.xtext.thingML.PrintAction;

/**
 * Created by jakobho on 28.03.2017.
 */
public class NodeJSThingActionCompiler extends JSThingActionCompiler {

}

@@ -1104,11 +1104,870 @@
 er %7B%0D%0A%0D%0A
+  @Override%0D%0A  public void generate(ErrorAction action, StringBuilder builder, Context ctx) %7B%0D%0A  %09for (Expression msg : action.getMsg()) %7B%0D%0A%09    builder.append(%22((process.stderr && process.stderr.write) %7C%7C console.log).call(process.stderr, ''+%22);%0D%0A%09    generate(msg, builder, ctx);%0D%0A%09    builder.append(%22);%5Cn%22);%0D%0A  %09%7D%0D%0A  %09if (action.isLine())%0D%0A  %09%09builder.append(%22if (process.stderr) process.stderr.write('%5C%5Cn');%5Cn%22);%0D%0A  %7D%0D%0A%0D%0A  @Override%0D%0A  public void generate(PrintAction action, StringBuilder builder, Context ctx) %7B%0D%0A  %09for (Expression msg : action.getMsg()) %7B%0D%0A        builder.append(%22((process.stdout && process.stdout.write) %7C%7C console.log).call(process.stdout, ''+%22);%0D%0A        generate(msg, builder, ctx);%0D%0A        builder.append(%22);%5Cn%22);%0D%0A  %09%7D%0D%0A  %09if (action.isLine())%0D%0A  %09%09builder.append(%22if (process.stdout) process.stdout.write('%5C%5Cn');%5Cn%22);%0D%0A  %7D%0D%0A
 %7D%0D%0A

Make NodeJS's prints compatible with Browsersify