removed spaces from tokens

This commit is contained in:
Denis Molony 2021-01-11 08:04:08 +10:00
parent fdc15f7eb3
commit 18289f382c
3 changed files with 35 additions and 36 deletions

View File

@ -942,8 +942,7 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
while ((b = buffer[ptr++]) != 0)
if (Utility.isHighBitSet (b))
text.append (
String.format (" %s ", ApplesoftConstants.tokens[b & 0x7F].trim ()));
text.append (String.format (" %s ", ApplesoftConstants.tokens[b & 0x7F]));
else
text.append ((char) b);

View File

@ -5,38 +5,38 @@ public interface ApplesoftConstants
// -----------------------------------------------------------------------------------//
{
String[] tokens = { //
"END ", "FOR ", "NEXT ", "DATA ", // 0x80 - 0x83
"INPUT ", "DEL ", "DIM ", "READ ", // 0x84 - 0x87
"GR ", "TEXT ", "PR# ", "IN# ", // 0x88 - 0x8B
"CALL ", "PLOT ", "HLIN ", "VLIN ", // 0x8C - 0x8F
"HGR2", "HGR", "HCOLOR=", "HPLOT ", // 0x90
"DRAW ", "XDRAW ", "HTAB ", "HOME ", // 0x94
"ROT=", "SCALE=", "SHLOAD ", "TRACE ", // 0x98
"NOTRACE ", "NORMAL ", "INVERSE ", "FLASH ", // 0x9C
"COLOR=", "POP ", "VTAB ", "HIMEM:", // 0xA0
"LOMEM:", "ONERR ", "RESUME", "RECALL ", // 0xA4 - 0xA7
"STORE ", "SPEED=", "LET ", "GOTO ", // 0xA8
"RUN ", "IF ", "RESTORE ", "& ", // 0xAC
"GOSUB ", "RETURN ", "REM ", "STOP ", // 0xB0
"ON ", "WAIT ", "LOAD ", "SAVE ", // 0xB4
"DEF ", "POKE ", "PRINT ", "CONT", // 0xB8
"LIST ", "CLEAR ", "GET ", "NEW ", // 0xBC
"TAB(", "TO ", "FN ", "SPC(", // 0xC0
"THEN ", "AT ", "NOT ", "STEP ", // 0xC4
"+ ", "- ", "* ", "/ ", // 0xC8
"^ ", "AND ", "OR ", "> ", // 0xCC
"= ", "< ", "SGN ", "INT ", // 0xD0
"ABS ", "USR", "FRE ", "SCRN(", // 0xD4
"PDL ", "POS ", "SQR ", "RND ", // 0xD8
"LOG ", "EXP ", "COS ", "SIN ", // 0xDC
"TAN ", "ATN ", "PEEK ", "LEN ", // 0xE0 - 0xE3
"STR$ ", "VAL ", "ASC ", "CHR$ ", // 0xE4 - 0xE7
"LEFT$ ", "RIGHT$ ", "MID$ ", "", // 0xE8 - 0xEB
"", "", "", "", // 0xEC - 0xEF
"ELSE", "MOD", "INC", "DEC", // 0xF0 - 0xF3
"DEEK", "DOKE", "REPEAT", "UNTIL", // 0xF4 - 0xF7
"", "", "", "", // 0xF8 - 0xFB
"", "", "", "", // 0xFC - 0xFF
"END", "FOR", "NEXT", "DATA", // 0x80 - 0x83
"INPUT", "DEL", "DIM", "READ", // 0x84 - 0x87
"GR", "TEXT", "PR#", "IN#", // 0x88 - 0x8B
"CALL", "PLOT", "HLIN", "VLIN", // 0x8C - 0x8F
"HGR2", "HGR", "HCOLOR=", "HPLOT", // 0x90
"DRAW", "XDRAW", "HTAB", "HOME", // 0x94
"ROT=", "SCALE=", "SHLOAD", "TRACE", // 0x98
"NOTRACE", "NORMAL", "INVERSE", "FLASH", // 0x9C
"COLOR=", "POP", "VTAB", "HIMEM:", // 0xA0
"LOMEM:", "ONERR", "RESUME", "RECALL", // 0xA4 - 0xA7
"STORE", "SPEED=", "LET", "GOTO", // 0xA8
"RUN", "IF", "RESTORE", "&", // 0xAC
"GOSUB", "RETURN", "REM", "STOP", // 0xB0
"ON", "WAIT", "LOAD", "SAVE", // 0xB4
"DEF", "POKE", "PRINT", "CONT", // 0xB8
"LIST", "CLEAR", "GET", "NEW", // 0xBC
"TAB(", "TO", "FN", "SPC(", // 0xC0
"THEN", "AT", "NOT", "STEP", // 0xC4
"+", "-", "*", "/", // 0xC8
"^", "AND", "OR", ">", // 0xCC
"=", "<", "SGN", "INT", // 0xD0
"ABS", "USR", "FRE", "SCRN(", // 0xD4
"PDL", "POS", "SQR", "RND", // 0xD8
"LOG", "EXP", "COS", "SIN", // 0xDC
"TAN", "ATN", "PEEK", "LEN", // 0xE0 - 0xE3
"STR$", "VAL", "ASC", "CHR$", // 0xE4 - 0xE7
"LEFT$", "RIGHT$", "MID$", "", // 0xE8 - 0xEB
"", "", "", "", // 0xEC - 0xEF
"", "", "", "", // 0xF0 - 0xF3
"", "", "", "", // 0xF4 - 0xF7
"", "", "", "", // 0xF8 - 0xFB
"", "", "", "", // 0xFC - 0xFF
};
static final byte TOKEN_FOR = (byte) 0x81;

View File

@ -543,7 +543,7 @@ public class SubLine implements ApplesoftConstants
for (int p = startPtr; p <= max; p++)
{
byte b = buffer[p];
if (Utility.isHighBitSet (b))
if (Utility.isHighBitSet (b)) // token
{
if (line.length () > 0 && line.charAt (line.length () - 1) != ' ')
line.append (' ');
@ -551,7 +551,7 @@ public class SubLine implements ApplesoftConstants
if (val < ApplesoftConstants.tokens.length)
{
if (b != TOKEN_THEN || ApplesoftBasicProgram.basicPreferences.showThen)
line.append (ApplesoftConstants.tokens[val]);
line.append (ApplesoftConstants.tokens[val] + " ");
}
}
else if (Utility.isControlCharacter (b))