diff --git a/examples/css.pegjs b/examples/css.pegjs index ceba571..1199cff 100644 --- a/examples/css.pegjs +++ b/examples/css.pegjs @@ -23,13 +23,12 @@ } function extractList(list, index) { - return list - .map(function(element) { return element[index]; }) - .filter(function(element) { return element !== null; }); + return list.map(function(element) { return element[index]; }); } function buildList(head, tail, index) { - return (head !== null ? [head] : []).concat(extractList(tail, index)); + return [head].concat(extractList(tail, index)) + .filter(function(element) { return element !== null; }); } function buildExpression(head, tail) {