From 512f748802f51cf1e07fd7824f1e68d037955920 Mon Sep 17 00:00:00 2001 From: Decagon Date: Wed, 27 Jul 2016 12:18:42 -0300 Subject: [PATCH] Add basic check for too many parenthesis --- pedant.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pedant.js b/pedant.js index 7b2dc2e..11029d9 100644 --- a/pedant.js +++ b/pedant.js @@ -21,6 +21,12 @@ var pedant = { for (var j = 0; j < lines.length; j++) { text = lines[j]; for (var i = 0; i < text.length; i++) { + if ("(".indexOf(text[i]) > -1) { + if ("(".indexOf(text[i + 1]) > -1) { + printError("too many parenthesis", "PunctuationError", j, i); + } + } + if (punctuation.indexOf(text[i]) > -1) { if (punctuationAmount == 0) { punctuationStartIndex = i;