From 72a381b2a00f3832d8d74dbc9a5faa88fda0450a Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 26 Sep 2014 01:01:02 +0300 Subject: Changing some variable names to more explicit ones to improve readability --- js/test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js') diff --git a/js/test.js b/js/test.js index 19c0c92..033ab32 100755 --- a/js/test.js +++ b/js/test.js @@ -30,13 +30,13 @@ fs.readFile('spec.txt', 'utf8', function(err, data) { .replace(/^(.|[\n])*/m, ''); tests.replace(/^\.\n([\s\S]*?)^\.\n([\s\S]*?)^\.$|^#{1,6} *(.*)$/gm, - function(_,x,y,z){ - if (z) { - current_section = z; + function(_,firstSubmatch,secondSubmatch,thirdSubmatch){ + if (thirdSubmatch) { + current_section = thirdSubmatch; } else { example_number++; - examples.push({markdown: x, - html: y, + examples.push({markdown: firstSubmatch, + html: secondSubmatch, section: current_section, number: example_number}); } -- cgit v1.2.3 From 3cb8720eb036ba89bb38fa9999393fac267c31da Mon Sep 17 00:00:00 2001 From: Arthur Date: Fri, 26 Sep 2014 22:40:07 +0300 Subject: Changing variable names even for even greater readability --- js/test.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js') diff --git a/js/test.js b/js/test.js index 033ab32..f2d06d8 100755 --- a/js/test.js +++ b/js/test.js @@ -30,13 +30,13 @@ fs.readFile('spec.txt', 'utf8', function(err, data) { .replace(/^(.|[\n])*/m, ''); tests.replace(/^\.\n([\s\S]*?)^\.\n([\s\S]*?)^\.$|^#{1,6} *(.*)$/gm, - function(_,firstSubmatch,secondSubmatch,thirdSubmatch){ - if (thirdSubmatch) { - current_section = thirdSubmatch; + function(_,markdownSubmatch,htmlSubmatch,sectionSubmatch){ + if (sectionSubmatch) { + current_section = sectionSubmatch; } else { example_number++; - examples.push({markdown: firstSubmatch, - html: secondSubmatch, + examples.push({markdown: markdownSubmatch, + html: htmlSubmatch, section: current_section, number: example_number}); } -- cgit v1.2.3