node_modules: update

This commit is contained in:
Dawid Dziurla
2020-08-30 12:08:22 +02:00
parent e8b7af2f44
commit 8e479bcc5d
10 changed files with 172 additions and 67 deletions

View File

@ -73,7 +73,7 @@ function _handleAddress(tokens) {
}
}
let _regexHandler = function(address) {
let _regexHandler = function (address) {
if (!data.address.length) {
data.address = [address.trim()];
return ' ';
@ -195,9 +195,9 @@ class Tokenizer {
* @param {String} chr Character from the address field
*/
checkChar(chr) {
if ((chr in this.operators || chr === '\\') && this.escaped) {
this.escaped = false;
} else if (this.operatorExpecting && chr === this.operatorExpecting) {
if (this.escaped) {
// ignore next condition blocks
} else if (chr === this.operatorExpecting) {
this.node = {
type: 'operator',
value: chr
@ -217,9 +217,7 @@ class Tokenizer {
this.operatorExpecting = this.operators[chr];
this.escaped = false;
return;
}
if (!this.escaped && chr === '\\') {
} else if (['"', "'"].includes(this.operatorExpecting) && chr === '\\') {
this.escaped = true;
return;
}
@ -232,11 +230,17 @@ class Tokenizer {
this.list.push(this.node);
}
if (this.escaped && chr !== '\\') {
this.node.value += '\\';
if (chr === '\n') {
// Convert newlines to spaces. Carriage return is ignored as \r and \n usually
// go together anyway and there already is a WS for \n. Lone \r means something is fishy.
chr = ' ';
}
if (chr.charCodeAt(0) >= 0x21 || [' ', '\t'].includes(chr)) {
// skip command bytes
this.node.value += chr;
}
this.node.value += chr;
this.escaped = false;
}
}