| 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 27 | 1 1 1 1 21 21 20 20 20 1 19 | (function(sc) {
"use strict";
require("./parser");
var Parser = sc.lang.compiler.Parser;
/*
Braces :
{ : GeneratorExpression }
{ FunctionExpression }
*/
Parser.addParseMethod("Braces", function(opts) {
opts = opts || {};
var token = this.expect("{");
var colon = this.match(":");
this.unlex(token);
if (colon && !opts.blockList) {
return this.parseGeneratorExpression();
}
return this.parseFunctionExpression(opts);
});
})(sc);
|