This commit is contained in:
Denis Molony 2021-01-07 12:56:20 +10:00
parent 21f7da6fc5
commit ce0cabc8e2
3 changed files with 29 additions and 38 deletions

View File

@ -359,7 +359,7 @@ public class ApplesoftBasicProgram extends BasicProgram
showSymbolsLeft (fullText, functionLines, "Fnction");
if (basicPreferences.showConstants && !constants.isEmpty ())
showSymbolsRight (fullText, constants, "Const");
showSymbolsRight (fullText, constants, "Literal");
if (basicPreferences.listStrings && stringsLine.size () > 0)
{
@ -448,24 +448,7 @@ public class ApplesoftBasicProgram extends BasicProgram
heading (fullText, formatLeft, heading);
for (String symbol : map.keySet ()) // left-justify strings
{
StringBuilder text = new StringBuilder ();
text.append (String.format (formatLeft, symbol));
for (int lineNo : map.get (symbol))
{
if (text.length () > underline.length () - maxDigits + longestVarName)
{
fullText.append (text);
fullText.append ("\n");
text.setLength (0);
text.append (String.format (formatLeft, ""));
}
text.append (String.format (formatLineNumber, lineNo));
}
if (text.length () > longestVarName + 3)
fullText.append (text + "\n");
}
appendLineNumbers (fullText, String.format (formatLeft, symbol), map.get (symbol));
}
// ---------------------------------------------------------------------------------//
@ -476,24 +459,31 @@ public class ApplesoftBasicProgram extends BasicProgram
heading (fullText, formatRight, heading);
for (Integer symbol : map.keySet ()) // right-justify integers
{
StringBuilder text = new StringBuilder ();
text.append (String.format (formatRight, symbol));
for (int lineNo : map.get (symbol))
{
if (text.length () > underline.length () - maxDigits + longestVarName)
{
fullText.append (text);
fullText.append ("\n");
text.setLength (0);
text.append (String.format (formatRight, ""));
}
text.append (String.format (formatLineNumber, lineNo));
}
appendLineNumbers (fullText, String.format (formatRight, symbol), map.get (symbol));
}
if (text.length () > longestVarName + 3)
fullText.append (text + "\n");
// ---------------------------------------------------------------------------------//
private void appendLineNumbers (StringBuilder fullText, String symbol,
List<Integer> lineNumbers)
// ---------------------------------------------------------------------------------//
{
StringBuilder text = new StringBuilder ();
text.append (symbol);
for (int lineNo : lineNumbers)
{
if (text.length () > underline.length () - maxDigits + longestVarName)
{
fullText.append (text);
fullText.append ("\n");
text.setLength (0);
text.append (String.format (formatRight, ""));
}
text.append (String.format (formatLineNumber, lineNo));
}
if (text.length () > longestVarName + 3)
fullText.append (text + "\n");
}
// ---------------------------------------------------------------------------------//

View File

@ -44,7 +44,8 @@ public class SubLine
{
doToken (firstByte);
if (is (ApplesoftConstants.TOKEN_REM) || is (ApplesoftConstants.TOKEN_DATA)
|| is (ApplesoftConstants.TOKEN_AMPERSAND))
|| is (ApplesoftConstants.TOKEN_AMPERSAND)
|| is (ApplesoftConstants.TOKEN_CALL))
return;
}
else if (Utility.isDigit (firstByte))

View File

@ -149,7 +149,7 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
final JMenuItem showCallsItem = new JCheckBoxMenuItem ("List CALLs");
final JMenuItem showSymbolsItem = new JCheckBoxMenuItem ("List variables");
final JMenuItem showFunctionsItem = new JCheckBoxMenuItem ("List functions");
final JMenuItem showConstantsItem = new JCheckBoxMenuItem ("List constants");
final JMenuItem showConstantsItem = new JCheckBoxMenuItem ("List literals");
final JMenuItem showDuplicateSymbolsItem =
new JCheckBoxMenuItem ("List duplicate variables");
final JMenuItem listStringsItem = new JCheckBoxMenuItem ("List strings");
@ -262,8 +262,8 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
applesoftMenu.add (showSymbolsItem);
applesoftMenu.add (showFunctionsItem);
applesoftMenu.add (showConstantsItem);
applesoftMenu.add (showDuplicateSymbolsItem);
applesoftMenu.add (listStringsItem);
applesoftMenu.add (showDuplicateSymbolsItem);
assemblerMenu.add (showAssemblerHeaderItem);
assemblerMenu.add (showAssemblerTargetsItem);