| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 | 1 1 1 1 45 5 40 40 40 40 39 40 | (function(sc) {
"use strict";
require("./codegen");
var CodeGen = sc.lang.compiler.CodeGen;
CodeGen.addGenerateMethod("Program", function(node) {
if (!node.body.length) {
return [];
}
var body = this.withFunction([ "" ], function() { // "" compiled as $
return this.generateStatements(node.body);
});
var result = [ "(", body, ")" ];
if (!this.opts.bare) {
result = [ "SCScript", result, ";" ];
}
return result;
});
})(sc);
|