|
From: Christopher W. <caw...@us...> - 2006-01-04 00:00:37
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11117/src/org/rubypeople/rdt/internal/ui/text/ruby Modified Files: SymbolRule.java Log Message: fix ticket #63 (though there's still work to do to get this rule 100% right) Index: SymbolRule.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/ruby/SymbolRule.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** SymbolRule.java 20 Dec 2005 15:35:41 -0000 1.2 --- SymbolRule.java 4 Jan 2006 00:00:22 -0000 1.3 *************** *** 11,25 **** public class SymbolRule extends SingleCharacterPrefixRule { ! private static final char PREFIX = ':'; ! public SymbolRule(IToken token) { ! super(PREFIX, token, 2, Integer.MAX_VALUE); ! } ! ! protected boolean isValidCharacter(int c, int index) { ! if (!super.isValidCharacter(c, index)) return false; ! if (((char)c) == ':') return false; // other than first character (prefix) symbols can't contain another colon ! return true; ! } } --- 11,39 ---- public class SymbolRule extends SingleCharacterPrefixRule { ! private static final char PREFIX = ':'; ! public SymbolRule(IToken token) { ! super(PREFIX, token, 2, Integer.MAX_VALUE); ! } ! ! protected boolean isValidCharacter(int c, int index) { ! if (!super.isValidCharacter(c, index)) ! return false; ! char theChar = (char) c; ! switch (theChar) { ! case ':': // other than first character (prefix) symbols can't contain ! // another colon ! case '[': // FIXME This isn't always the case. There's special method names containing brackets that is valid (only the particular sequence) ! case ']': ! case '{': ! case '}': ! case '(': ! case ')': ! return false; ! ! default: ! return true; ! } ! } } |