|
From: <caw...@us...> - 2006-10-18 01:33:18
|
Revision: 1623
http://svn.sourceforge.net/rubyeclipse/?rev=1623&view=rev
Author: cawilliams
Date: 2006-10-17 18:33:14 -0700 (Tue, 17 Oct 2006)
Log Message:
-----------
patch up a nasty infinite loop bug (#198) - its still very ugly hacky code, but that particular example works now
Modified Paths:
--------------
trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/PercentSyntaxRule.java
Modified: trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/PercentSyntaxRule.java
===================================================================
--- trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/PercentSyntaxRule.java 2006-10-18 00:54:14 UTC (rev 1622)
+++ trunk/org.rubypeople.rdt.ui/src/org/rubypeople/rdt/internal/ui/text/PercentSyntaxRule.java 2006-10-18 01:33:14 UTC (rev 1623)
@@ -23,7 +23,7 @@
case 'W': // Array of strings
scanner.unread();
scanner.unread();
- // FIXME Mark teh individual elements as strings
+ // FIXME Mark the individual elements as strings
return Token.UNDEFINED;
default: // special case of string (no letter following percent)
scanner.unread();
@@ -43,18 +43,21 @@
c = scanner.read();
// FIXME This is a big hack. Expression substitution actually needs to be returned as normal ruby code (and repartitioned)
if ((char) c == '#') { // Try to handle expression substitution
- char d = (char) scanner.read();
- if (d == '{') {
+ int d = scanner.read();
+ if ((char) d == '{') {
// read until '}'
do {
- d = (char)scanner.read();
- } while (d != '}');
+ d = scanner.read();
+ if (d == ICharacterScanner.EOF) {
+ return new Token(tokenType);
+ }
+ } while ((char) d != '}');
continue;
- } else if (d == '@' || d == '$') {
+ } else if ((char) d == '@' || (char) d == '$') {
// read until whitespace
do {
- d = (char) scanner.read();
- } while (d != ' ');
+ d = scanner.read();
+ } while ((char) d != ' ');
continue;
} else {// not expression subst.
scanner.unread();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|