trim DATA

This commit is contained in:
Denis Molony 2021-01-15 08:37:17 +10:00
parent ca64401dde
commit 112fbc086b
1 changed files with 5 additions and 6 deletions

View File

@ -335,19 +335,18 @@ public class SubLine implements ApplesoftConstants
break;
case TOKEN_DATA:
lineBuffer = getBuffer ();
if (lineBuffer.length == 0)
break;
for (String chunk : new String (lineBuffer).split (","))
for (String chunk : new String (getBuffer ()).split (","))
{
chunk = chunk.trim ();
if (chunk.isEmpty ())
continue;
b = (byte) chunk.charAt (0);
if (Utility.isDigit (b) || b == Utility.ASCII_MINUS || b == Utility.ASCII_DOT)
addNumber (chunk);
else if (Utility.isLetter (b) || b == Utility.ASCII_QUOTE)
stringsText.add (chunk);
else
System.out.println ("Unknown data: " + chunk);
System.out.printf ("Unknown data: [%s]%n", chunk);
}
break;