|
@ -25,13 +25,22 @@ function escapedSplit(str) { |
|
|
ch = str.charCodeAt(pos); |
|
|
ch = str.charCodeAt(pos); |
|
|
|
|
|
|
|
|
while (pos < max) { |
|
|
while (pos < max) { |
|
|
if (ch === 0x60/* ` */ && (escapes % 2 === 0)) { |
|
|
if (ch === 0x60/* ` */) { |
|
|
backTicked = !backTicked; |
|
|
if (backTicked) { |
|
|
|
|
|
// make \` close code sequence, but not open it;
|
|
|
|
|
|
// the reason is: `\` is correct code block
|
|
|
|
|
|
backTicked = false; |
|
|
|
|
|
lastBackTick = pos; |
|
|
|
|
|
} else if (escapes % 2 === 0) { |
|
|
|
|
|
backTicked = true; |
|
|
lastBackTick = pos; |
|
|
lastBackTick = pos; |
|
|
|
|
|
} |
|
|
} else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) { |
|
|
} else if (ch === 0x7c/* | */ && (escapes % 2 === 0) && !backTicked) { |
|
|
result.push(str.substring(lastPos, pos)); |
|
|
result.push(str.substring(lastPos, pos)); |
|
|
lastPos = pos + 1; |
|
|
lastPos = pos + 1; |
|
|
} else if (ch === 0x5c/* \ */) { |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (ch === 0x5c/* \ */) { |
|
|
escapes++; |
|
|
escapes++; |
|
|
} else { |
|
|
} else { |
|
|
escapes = 0; |
|
|
escapes = 0; |
|
|