removed CALL target from integer list

This commit is contained in:
Denis Molony 2021-02-21 06:50:18 +10:00
parent ba6c067fb3
commit 1aaee043a3

View File

@ -55,7 +55,11 @@ public class SubLine implements ApplesoftConstants
doToken (firstByte); doToken (firstByte);
if (is (TOKEN_REM) || is (TOKEN_DATA)) // no further processing if (is (TOKEN_REM) || is (TOKEN_DATA)) // no further processing
return; return;
ptr = startPtr + 1;
if (is (TOKEN_CALL))
ptr = startPtr + callTarget.length ();
else
ptr = startPtr + 1;
} }
else else
{ {
@ -66,8 +70,8 @@ public class SubLine implements ApplesoftConstants
return; return;
} }
else if (Utility.isLetter (firstByte)) // variable assignment else if (Utility.isLetter (firstByte)) // variable assignment
recordEqualsPosition (); setEqualsPosition ();
else if (firstByte == Utility.ASCII_COLON || firstByte == 0) // empty subline else if (isEndOfLine (firstByte)) // empty subline
return; return;
else // probably Beagle Bros 0D or 0A else // probably Beagle Bros 0D or 0A
System.out.printf ("Unexpected bytes at %5d: %s%n", parent.lineNumber, System.out.printf ("Unexpected bytes at %5d: %s%n", parent.lineNumber,
@ -82,7 +86,7 @@ public class SubLine implements ApplesoftConstants
int stringPtr = 0; int stringPtr = 0;
int max = startPtr + length - 1; int max = startPtr + length - 1;
if (buffer[max] == 0 || buffer[max] == Utility.ASCII_COLON) if (isEndOfLine (buffer[max]))
--max; --max;
while (ptr <= max) while (ptr <= max)
@ -162,6 +166,13 @@ public class SubLine implements ApplesoftConstants
checkVar (var, (byte) 0); // unprocessed variable or number checkVar (var, (byte) 0); // unprocessed variable or number
} }
// ---------------------------------------------------------------------------------//
private boolean isEndOfLine (byte b)
// ---------------------------------------------------------------------------------//
{
return b == 0 || b == Utility.ASCII_COLON;
}
// ---------------------------------------------------------------------------------// // ---------------------------------------------------------------------------------//
private void addString (int stringPtr, int ptr) private void addString (int stringPtr, int ptr)
// ---------------------------------------------------------------------------------// // ---------------------------------------------------------------------------------//
@ -285,7 +296,7 @@ public class SubLine implements ApplesoftConstants
break; break;
case TOKEN_LET: case TOKEN_LET:
recordEqualsPosition (); setEqualsPosition ();
break; break;
case TOKEN_GOTO: case TOKEN_GOTO:
@ -484,7 +495,7 @@ public class SubLine implements ApplesoftConstants
// Record the position of the equals sign so it can be aligned with adjacent lines. // Record the position of the equals sign so it can be aligned with adjacent lines.
// ---------------------------------------------------------------------------------// // ---------------------------------------------------------------------------------//
private void recordEqualsPosition () private void setEqualsPosition ()
// ---------------------------------------------------------------------------------// // ---------------------------------------------------------------------------------//
{ {
int p = startPtr + 1; int p = startPtr + 1;