From 320ae73475422af4fa5f1af1a953497b1de41283 Mon Sep 17 00:00:00 2001 From: Michael Jackson Date: Fri, 28 Dec 2012 13:41:52 -0800 Subject: [PATCH] Style tweaks --- mustache.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/mustache.js b/mustache.js index be39d6ba5..c99f6bfda 100644 --- a/mustache.js +++ b/mustache.js @@ -398,7 +398,7 @@ nonSpace = false; } - var start, type, value, chr; + var start, type, value, chr, token; while (!scanner.eos()) { start = scanner.pos; value = scanner.scanUntil(tagRes[0]); @@ -413,24 +413,21 @@ nonSpace = true; } - tokens.push(["text", chr, start, start + 1]); + tokens.push(['text', chr, start, start + 1]); start += 1; - if (chr === "\n") { - stripSpace(); // Check for whitespace on the current line. - } + // Check for whitespace on the current line. + if (chr == '\n') stripSpace(); } } start = scanner.pos; // Match the opening tag. - if (!scanner.scan(tagRes[0])) { - break; - } - + if (!scanner.scan(tagRes[0])) break; hasTag = true; - type = scanner.scan(tagRe) || "name"; + + type = scanner.scan(tagRe) || 'name'; // Skip any whitespace between tag and value. scanner.scan(whiteRe); @@ -468,7 +465,7 @@ } } - var token = [type, value, start, scanner.pos]; + token = [type, value, start, scanner.pos]; tokens.push(token); if (type === '#' || type === '^') {