From e546af5543f4db32878f492486193f185b71397d Mon Sep 17 00:00:00 2001 From: David Majda Date: Mon, 4 Jul 2016 09:04:47 +0200 Subject: [PATCH] Regenerate lib/parser.js --- lib/parser.js | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/lib/parser.js b/lib/parser.js index f5497fd..8e211f6 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -121,11 +121,18 @@ descriptions.length = j; } - return descriptions.length > 1 - ? descriptions.slice(0, -1).join(", ") - + " or " - + descriptions[descriptions.length - 1] - : descriptions[0]; + switch (descriptions.length) { + case 1: + return descriptions[0]; + + case 2: + return descriptions[0] + " or " + descriptions[1]; + + default: + return descriptions.slice(0, -1).join(", ") + + ", or " + + descriptions[descriptions.length - 1]; + } } function describeFound(found) { @@ -138,9 +145,7 @@ function peg$parse(input, options) { options = options !== void 0 ? options : {}; - var parser = this, - - peg$FAILED = {}, + var peg$FAILED = {}, peg$startRuleFunctions = { Grammar: peg$parseGrammar }, peg$startRuleFunction = peg$parseGrammar,