@@ -206,7 +206,7 @@ var EX_EOF = {};
|
|||||||
function tokenizer($TEXT, filename, html5_comments) {
|
function tokenizer($TEXT, filename, html5_comments) {
|
||||||
|
|
||||||
var S = {
|
var S = {
|
||||||
text : $TEXT.replace(/\r\n?|[\n\u2028\u2029]/g, "\n").replace(/\uFEFF/g, ''),
|
text : $TEXT.replace(/\uFEFF/g, ''),
|
||||||
filename : filename,
|
filename : filename,
|
||||||
pos : 0,
|
pos : 0,
|
||||||
tokpos : 0,
|
tokpos : 0,
|
||||||
@@ -225,10 +225,15 @@ function tokenizer($TEXT, filename, html5_comments) {
|
|||||||
var ch = S.text.charAt(S.pos++);
|
var ch = S.text.charAt(S.pos++);
|
||||||
if (signal_eof && !ch)
|
if (signal_eof && !ch)
|
||||||
throw EX_EOF;
|
throw EX_EOF;
|
||||||
if (ch == "\n") {
|
if ("\r\n\u2028\u2029".indexOf(ch) >= 0) {
|
||||||
S.newline_before = S.newline_before || !in_string;
|
S.newline_before = S.newline_before || !in_string;
|
||||||
++S.line;
|
++S.line;
|
||||||
S.col = 0;
|
S.col = 0;
|
||||||
|
if (!in_string && ch == "\r" && peek() == "\n") {
|
||||||
|
// treat a \r\n sequence as a single \n
|
||||||
|
++S.pos;
|
||||||
|
ch = "\n";
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
++S.col;
|
++S.col;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user