Plato on Github
Report Home
lang/compiler/parser/expression.js
Maintainability
121.42
Lines of code
39
Difficulty
11.38
Estimated Errors
0.19
Function weight
By Complexity
By SLOC
(function(sc) { "use strict"; require("./parser"); var Parser = sc.lang.compiler.Parser; /* Expression : AssignmentExpression */ Parser.addParseMethod("Expression", function() { return this.parseAssignmentExpression(); }); /* Expressions : Expression Expressions ; Expression */ Parser.addParseMethod("Expressions", function() { var nodes = []; while (this.hasNextToken() && !this.matchAny([ ",", ")", "]", "}", ":", ".." ])) { nodes.push( this.parseExpression() ); if (this.match(";")) { this.lex(); } } if (nodes.length === 0) { this.throwUnexpected(this.lookahead); } return nodes.length === 1 ? nodes[0] : nodes; }); })(sc);