diff --git a/lib/Parser.js b/lib/Parser.js index c00a1ac02..426c38337 100644 --- a/lib/Parser.js +++ b/lib/Parser.js @@ -11,7 +11,7 @@ var CH_LF = 10, LITPLACEHOLDER = String.fromCharCode(0), EMPTY_READCB = function(n) {}, RE_INTEGER = /^\d+$/, - RE_PRECEDING = /^(?:(?:\*|A\d+) )|\+ ?/, + RE_PRECEDING = /^(?:(?:\*|A\d+) )|^\+ ?/, RE_BODYLITERAL = /BODY\[(.*)\] \{(\d+)\}$/i, RE_BODYINLINEKEY = /^BODY\[(.*)\]$/i, RE_SEQNO = /^\* (\d+)/, diff --git a/test/test-parser.js b/test/test-parser.js index f43857134..3ac592f12 100644 --- a/test/test-parser.js +++ b/test/test-parser.js @@ -20,6 +20,10 @@ var CR = '\r', LF = '\n', CRLF = CR + LF; expected: [ 'IDLE OK IDLE terminated' ], what: 'Unknown line' }, + { source: ['IDLE OK Idle completed (0.001 + 0.081 + 0.081 secs).', CRLF], + expected: [ 'IDLE OK Idle completed (0.001 + 0.081 + 0.081 secs).' ], + what: 'Unknown line with + char' + }, { source: ['+ idling', CRLF], expected: [ { textCode: undefined, text: 'idling'