Plato on Github
Report Home
lang/compiler/codegen/var-stmt.js
Maintainability
124.39
Lines of code
25
Difficulty
8.38
Estimated Errors
0.17
Function weight
By Complexity
By SLOC
(function(sc) { "use strict"; require("./codegen"); var CodeGen = sc.lang.compiler.CodeGen; CodeGen.addGenerateMethod("VariableDeclaration", function(node) { var scope = this.state.syncBlockScope; return this.stitchWith(node.declarations, ",", function(item) { this.scope.add("var", item.id.name, scope); var result = [ this.generate(item.id) ]; if (item.init) { result.push("=", this.generate(item.init)); } else { result.push("=$.Nil()"); } return result; }); }); })(sc);