[Pydev-cvs] org.python.pydev.core/src/org/python/pydev/core/docutils ParsingUtils.java, 1.24, 1.25
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2008-07-14 23:02:15
|
Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2410/src/org/python/pydev/core/docutils Modified Files: ParsingUtils.java Log Message: Better handling of assign on fast parsing. Index: ParsingUtils.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils/ParsingUtils.java,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** ParsingUtils.java 6 Jul 2008 21:58:28 -0000 1.24 --- ParsingUtils.java 14 Jul 2008 23:02:23 -0000 1.25 *************** *** 241,244 **** --- 241,290 ---- } + + /** + * @param i the index where we should start getting chars + * @param buf the buffer that should be filled with the contents gotten (if null, they're ignored) + * @return the index where the parsing stopped + */ + public int getFullFlattenedLine(int i, FastStringBuffer buf) { + char c = this.charAt(i); + int len = len(); + boolean ignoreNextNewLine = false; + while(i < len){ + c = charAt(i); + + i++; + + if(c == '\'' || c == '"'){ //ignore comments or multiline comments... + i = eatLiterals(null, i-1)+1; + + }else if(c == '#'){ + i = eatComments(null, i-1)+1; + break; + + }else if( c == '(' || c == '[' || c == '{'){ //open par. + i = eatPar(i-1, null, c)+1; + + }else if( c == '\r' || c == '\n' ){ + if(!ignoreNextNewLine){ + break; + } + + }else if( c == '\\' || c == '\\' ){ + ignoreNextNewLine = true; + continue; + + }else{ + if(buf != null){ + buf.append(c); + } + } + + ignoreNextNewLine = false; + } + return i; + } + + /** * @param buf if null, it'll simply advance without adding anything to the buffer. *************** *** 609,612 **** - } --- 655,657 ---- |