[Pydev-cvs] org.python.pydev/src/org/python/copiedfromeclipsesrc PythonPairMatcher.java,1.3,1.4
Brought to you by:
fabioz
From: Fabio Z. <fa...@us...> - 2006-03-15 02:05:53
|
Update of /cvsroot/pydev/org.python.pydev/src/org/python/copiedfromeclipsesrc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16042/src/org/python/copiedfromeclipsesrc Modified Files: PythonPairMatcher.java Log Message: Index: PythonPairMatcher.java =================================================================== RCS file: /cvsroot/pydev/org.python.pydev/src/org/python/copiedfromeclipsesrc/PythonPairMatcher.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** PythonPairMatcher.java 17 Oct 2005 16:58:59 -0000 1.3 --- PythonPairMatcher.java 15 Mar 2006 02:05:48 -0000 1.4 *************** *** 180,184 **** } catch (BadLocationException x) { - } catch (IOException x) { } --- 180,183 ---- *************** *** 196,219 **** * @throws IOException */ ! protected int searchForClosingPeer(int offset, char openingPeer, char closingPeer, IDocument document) ! throws IOException { ! fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true); ! int stack = 1; ! int c = fReader.read(); ! while (c != PythonCodeReader.EOF) { ! if (c == openingPeer && c != closingPeer) ! stack++; ! else if (c == closingPeer) ! stack--; ! if (stack == 0) ! return fReader.getOffset(); ! c = fReader.read(); } - - return -1; } --- 195,220 ---- * @throws IOException */ ! public int searchForClosingPeer(int offset, char openingPeer, char closingPeer, IDocument document){ ! try { ! fReader.configureForwardReader(document, offset + 1, document.getLength(), true, true); ! int stack = 1; ! char c = (char)fReader.read(); ! while (c != PythonCodeReader.EOF) { ! if (c == openingPeer && c != closingPeer) ! stack++; ! else if (c == closingPeer) ! stack--; ! if (stack == 0) ! return fReader.getOffset(); ! c = (char) fReader.read(); ! } ! return -1; ! } catch (Exception e) { ! throw new RuntimeException(e); } } |