From a8021fafc4ffb13bbbb0c0cec137f651a28dd429 Mon Sep 17 00:00:00 2001 From: laoxiong Date: Thu, 17 Aug 2017 03:51:56 +0800 Subject: [PATCH] chore: add comment for whitespace char code (#676) --- src/tokenizer/index.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/tokenizer/index.js b/src/tokenizer/index.js index de2e0decd7..760ccf5ee8 100644 --- a/src/tokenizer/index.js +++ b/src/tokenizer/index.js @@ -283,19 +283,19 @@ export default class Tokenizer extends LocationParser { loop: while (this.state.pos < this.input.length) { const ch = this.input.charCodeAt(this.state.pos); switch (ch) { - case 32: - case 160: // ' ' + case 32: // space + case 160: // non-breaking space ++this.state.pos; break; - case 13: + case 13: // '\r' carriage return if (this.input.charCodeAt(this.state.pos + 1) === 10) { ++this.state.pos; } - case 10: - case 8232: - case 8233: + case 10: // '\n' line feed + case 8232: // line separator + case 8233: // paragraph separator ++this.state.pos; ++this.state.curLine; this.state.lineStart = this.state.pos;