|
From: Christopher W. <caw...@us...> - 2006-06-09 00:13:00
|
Update of /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text In directory sc8-pr-cvs9.sourceforge.net:/tmp/cvs-serv23555/src/org/rubypeople/rdt/internal/ui/text Modified Files: RubyPartitionScanner.java Log Message: handle ?", ?', and ?/ as characters (not starts of strings or regex) Index: RubyPartitionScanner.java =================================================================== RCS file: /cvsroot/rubyeclipse/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/RubyPartitionScanner.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** RubyPartitionScanner.java 12 May 2006 21:39:35 -0000 1.12 --- RubyPartitionScanner.java 9 Jun 2006 00:12:57 -0000 1.13 *************** *** 11,14 **** --- 11,15 ---- import org.eclipse.jface.text.rules.IRule; import org.eclipse.jface.text.rules.IToken; + import org.eclipse.jface.text.rules.IWordDetector; import org.eclipse.jface.text.rules.MultiLineRule; import org.eclipse.jface.text.rules.PatternRule; *************** *** 79,82 **** --- 80,118 ---- rules.add(new WordPatternRule(new NumberSignDetector(), "?", "#", Token.UNDEFINED)); + // ugly hacks to make ?" and ?' recognized as characters + rules.add(new WordPatternRule(new IWordDetector() { + + public boolean isWordPart(char c) { + return c == '"'; + } + + public boolean isWordStart(char c) { + return c == '?'; + } + + }, "?", "\"", Token.UNDEFINED)); + rules.add(new WordPatternRule(new IWordDetector() { + + public boolean isWordPart(char c) { + return c == '\''; + } + + public boolean isWordStart(char c) { + return c == '?'; + } + + }, "?", "'", Token.UNDEFINED)); + rules.add(new WordPatternRule(new IWordDetector() { + + public boolean isWordPart(char c) { + return c == '/'; + } + + public boolean isWordStart(char c) { + return c == '?'; + } + + }, "?", "/", Token.UNDEFINED)); + rules.add(new EndOfLineRule("#", singleLineComment)); // Multiline comments |