load .we with layers
- and fix some bug : max is within range ( perhaps not as many as those added ...) - quick hack in CharProvider to skip spaces ... ( bad it applies to strings too ...)
This commit is contained in:
@@ -4,6 +4,7 @@ public class CharProvider {
|
||||
|
||||
String input;
|
||||
int current;
|
||||
int last;
|
||||
|
||||
public CharProvider(String input) {
|
||||
this.input = input;
|
||||
@@ -13,9 +14,16 @@ public class CharProvider {
|
||||
public char getNextchar()
|
||||
{
|
||||
int i = current;
|
||||
if ( input.length() > current) {
|
||||
current++;
|
||||
return input.charAt(i);
|
||||
int max = input.length();
|
||||
if ( max > current) {
|
||||
char c = 0;
|
||||
last = current;
|
||||
while ( ( max > i ) && ( c = input.charAt(i) ) == ' ' )
|
||||
{
|
||||
i++;
|
||||
}
|
||||
current = i + 1;
|
||||
return c;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -26,7 +34,7 @@ public class CharProvider {
|
||||
public void pushBackChar(char c)
|
||||
{
|
||||
System.out.print('*');
|
||||
current--;
|
||||
current = last;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user