|
|
@ -17,7 +17,7 @@ var CH_LF = 10,
|
|
|
|
RE_SEQNO = /^\* (\d+)/,
|
|
|
|
RE_SEQNO = /^\* (\d+)/,
|
|
|
|
RE_LISTCONTENT = /^\((.*)\)$/,
|
|
|
|
RE_LISTCONTENT = /^\((.*)\)$/,
|
|
|
|
RE_LITERAL = /\{(\d+)\}$/,
|
|
|
|
RE_LITERAL = /\{(\d+)\}$/,
|
|
|
|
RE_UNTAGGED = /^\* (?:(OK|NO|BAD|BYE|FLAGS|ID|LIST|LSUB|SEARCH|STATUS|CAPABILITY|NAMESPACE|PREAUTH|SORT|THREAD|ESEARCH|QUOTA|QUOTAROOT)|(\d+) (EXPUNGE|FETCH|RECENT|EXISTS))(?:(?: \[([^\]]+)\])?(?: (.+))?)?$/i,
|
|
|
|
RE_UNTAGGED = /^\* (?:(OK|NO|BAD|BYE|FLAGS|ID|LIST|XLIST|LSUB|SEARCH|STATUS|CAPABILITY|NAMESPACE|PREAUTH|SORT|THREAD|ESEARCH|QUOTA|QUOTAROOT)|(\d+) (EXPUNGE|FETCH|RECENT|EXISTS))(?:(?: \[([^\]]+)\])?(?: (.+))?)?$/i,
|
|
|
|
RE_TAGGED = /^A(\d+) (OK|NO|BAD) (?:\[([^\]]+)\] )?(.+)$/i,
|
|
|
|
RE_TAGGED = /^A(\d+) (OK|NO|BAD) (?:\[([^\]]+)\] )?(.+)$/i,
|
|
|
|
RE_CONTINUE = /^\+(?: (?:\[([^\]]+)\] )?(.+))?$/i,
|
|
|
|
RE_CONTINUE = /^\+(?: (?:\[([^\]]+)\] )?(.+))?$/i,
|
|
|
|
RE_CRLF = /\r\n/g,
|
|
|
|
RE_CRLF = /\r\n/g,
|
|
|
@ -247,7 +247,7 @@ Parser.prototype._resUntagged = function() {
|
|
|
|
val = parseExpr(m[5], this._literals);
|
|
|
|
val = parseExpr(m[5], this._literals);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
val = [];
|
|
|
|
val = [];
|
|
|
|
} else if (type === 'list' || type === 'lsub')
|
|
|
|
} else if (type === 'list' || type === 'lsub' || type === 'xlist')
|
|
|
|
val = parseBoxList(m[5], this._literals);
|
|
|
|
val = parseBoxList(m[5], this._literals);
|
|
|
|
else if (type === 'id')
|
|
|
|
else if (type === 'id')
|
|
|
|
val = parseId(m[5], this._literals);
|
|
|
|
val = parseId(m[5], this._literals);
|
|
|
@ -889,7 +889,7 @@ function decodeWords(str, state) {
|
|
|
|
state.replaces = [];
|
|
|
|
state.replaces = [];
|
|
|
|
|
|
|
|
|
|
|
|
var bytes, m, next, i, j, leni, lenj, seq, replaces = [], lastReplace = {};
|
|
|
|
var bytes, m, next, i, j, leni, lenj, seq, replaces = [], lastReplace = {};
|
|
|
|
|
|
|
|
|
|
|
|
// join consecutive q-encoded words that have the same charset first
|
|
|
|
// join consecutive q-encoded words that have the same charset first
|
|
|
|
while (m = RE_ENCWORD.exec(str)) {
|
|
|
|
while (m = RE_ENCWORD.exec(str)) {
|
|
|
|
seq = {
|
|
|
|
seq = {
|
|
|
|