From c8365fc930e7fc62e1599cc66f764c30d15da8ca Mon Sep 17 00:00:00 2001 From: Alan Knowles Date: Fri, 23 Sep 2011 12:03:05 +0800 Subject: [PATCH] Pman.SearchTokenizer.js --- Pman.SearchTokenizer.js | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/Pman.SearchTokenizer.js b/Pman.SearchTokenizer.js index a55605de..7e839ed1 100644 --- a/Pman.SearchTokenizer.js +++ b/Pman.SearchTokenizer.js @@ -54,10 +54,11 @@ Pman.SearchTokenizer.prototype = { }, strParse : function () { - - str = ''; + var c; + var str = ''; while(true) { - if (false === (c = this.getChar())) { + c = this.getChar(); + if (false === c) { this.addStr(str); return; } @@ -68,7 +69,7 @@ Pman.SearchTokenizer.prototype = { case '(': case ')': this.addStr(str); this.ungetChar(); return; case '"': - if (strlen(str)) { + if (str.length) { this.addStr(str); str = ''; } @@ -76,17 +77,20 @@ Pman.SearchTokenizer.prototype = { break; default : - str .= c; + str += c; continue; } } - } - function strParseQuoted(end) + }, + + strParseQuoted: function (end) { - str = ''; /// ignore \" slashed ??? + var str = ''; /// ignore \" slashed ??? + var c; while(true) { - if (false === (c = this.getChar())) { + c = this.getChar(); + if (false === c) { this.addStr(str,true); return; } @@ -94,7 +98,7 @@ Pman.SearchTokenizer.prototype = { this.addStr(str,true); return; } - str .= c; + str += c; } } -- 2.39.2