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) while ((b = buffer[ptr++]) != 0)
if (Utility.isHighBitSet (b)) if (Utility.isHighBitSet (b))
text.append ( text.append (String.format (" %s ", ApplesoftConstants.tokens[b & 0x7F]));
String.format (" %s ", ApplesoftConstants.tokens[b & 0x7F].trim ()));
else else
text.append ((char) b); text.append ((char) b);

View File

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

View File

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