From: william b. <wil...@us...> - 2008-05-16 18:50:21
|
Update of /cvsroot/jboost/jboost/src/jboost/tokenizer In directory sc8-pr-cvs17.sourceforge.net:/tmp/cvs-serv10384/src/jboost/tokenizer Modified Files: LTStreamTokenizer.java Log Message: fixed legacy bugs that prevented comments from being parsed reliably, or at all. Index: LTStreamTokenizer.java =================================================================== RCS file: /cvsroot/jboost/jboost/src/jboost/tokenizer/LTStreamTokenizer.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** LTStreamTokenizer.java 16 May 2007 04:06:02 -0000 1.1.1.1 --- LTStreamTokenizer.java 16 May 2008 18:50:01 -0000 1.2 *************** *** 71,75 **** this.terminator= terminator; terLen= terminator.length(); ! minLen= terLen >= 2 ? 2 : terLen; for (int i= 0, terLines= 0; i < terLen; i++) if (terminator.charAt(i) == '\n') --- 71,75 ---- this.terminator= terminator; terLen= terminator.length(); ! minLen= terLen <= 2 ? 2 : terLen; for (int i= 0, terLines= 0; i < terLen; i++) if (terminator.charAt(i) == '\n') *************** *** 135,139 **** while (true) { // if(Monitor.logLevel>3) Monitor.log("strLen=" + strLen + " toCopy=" + toCopy + " i=" + i); ! if (i > strLen - minLen) { try { numRead= br.read(cBuf, 0, bufLen); --- 135,139 ---- while (true) { // if(Monitor.logLevel>3) Monitor.log("strLen=" + strLen + " toCopy=" + toCopy + " i=" + i); ! if (i > strLen - minLen) { try { numRead= br.read(cBuf, 0, bufLen); *************** *** 206,210 **** if (Util.even(numEscapes)) { // line comment starts! curTok += strBuf.substring(toCopy, i - numEscapes / 2); ! ongoingComment= true; } else // escpaed, part of token curTok --- 206,210 ---- if (Util.even(numEscapes)) { // line comment starts! curTok += strBuf.substring(toCopy, i - numEscapes / 2); ! lineComment= true; } else // escpaed, part of token curTok |