Update of /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28721/src/org/python/pydev/core/docutils
Modified Files:
ParsingUtils.java
Log Message:
- Improved code formatter to deal with operators (+, -, *, etc)
- Improved code formatter to handle '=' differently inside function calls / keyword args
Index: ParsingUtils.java
===================================================================
RCS file: /cvsroot/pydev/org.python.pydev.core/src/org/python/pydev/core/docutils/ParsingUtils.java,v
retrieving revision 1.25
retrieving revision 1.26
diff -C2 -d -r1.25 -r1.26
*** ParsingUtils.java 14 Jul 2008 23:02:23 -0000 1.25
--- ParsingUtils.java 19 Jul 2008 19:53:36 -0000 1.26
***************
*** 163,167 ****
* return it.
* @param i the # position
! * @return the end of the comments position (end of document or new line char)
*/
public int eatComments(FastStringBuffer buf, int i) {
--- 163,168 ----
* return it.
* @param i the # position
! * @return the end of the comments position (end of document or new line char)
! * @note the new line char (\r or \n) will be added as a part of the comment.
*/
public int eatComments(FastStringBuffer buf, int i) {
***************
*** 186,194 ****
/**
* @param cs the char array we are parsing
* @param buf used to add the literal contents (out)
* @param i the ' or " position
! * @return the end of the literal position (or end of document)
*/
public int eatLiterals(FastStringBuffer buf, int i) {
--- 187,226 ----
+
+
+ /**
+ * @param cs the char array we are parsing
+ * @param buf used to add the spaces (out) -- if it's null, it'll simply advance to the position and
+ * return it.
+ * @param i the first ' ' position
+ * @return the position of the last space found
+ */
+ public int eatWhitespaces(FastStringBuffer buf, int i) {
+ int len = len();
+ char c;
+
+ while(i < len && (c = charAt(i)) == ' '){
+ if(buf != null){
+ buf.append(c);
+ }
+ i++;
+ }
+
+ //go back to the last space found
+ i--;
+
+ return i;
+ }
+
+
+
+
+
+
/**
* @param cs the char array we are parsing
* @param buf used to add the literal contents (out)
* @param i the ' or " position
! * @return the end of the literal position (or end of document) -- so, the final char is the ' or " position
*/
public int eatLiterals(FastStringBuffer buf, int i) {
***************
*** 655,657 ****
--- 687,691 ----
+
+
}
|