mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-02-18 05:30:29 +00:00
combine literals and strings under constants
This commit is contained in:
parent
4a435e64e7
commit
85f0f17e61
@ -446,7 +446,7 @@ public class ApplesoftBasicProgram extends BasicProgram implements ApplesoftCons
|
||||
if (basicPreferences.showConstants && !constantsFloat.isEmpty ())
|
||||
showSymbolsRightFloat (fullText, constantsFloat, "Float");
|
||||
|
||||
if (basicPreferences.listStrings && stringsLine.size () > 0)
|
||||
if (basicPreferences.showConstants && stringsLine.size () > 0)
|
||||
{
|
||||
heading (fullText, formatRight, "Line", "String");
|
||||
for (int i = 0; i < stringsLine.size (); i++)
|
||||
|
@ -111,9 +111,10 @@ public class SubLine implements ApplesoftConstants
|
||||
continue;
|
||||
}
|
||||
|
||||
if (Utility.isPossibleVariable (b) || b == Utility.ASCII_DOT) // A-Z 0-9 $ % .
|
||||
if (Utility.isPossibleVariable (b) || Utility.isPossibleNumber (b))
|
||||
{
|
||||
if (var.isEmpty () && Utility.isDigit (b) && buffer[ptr - 2] == TOKEN_MINUS)
|
||||
if (var.isEmpty () && Utility.isPossibleNumber (b)
|
||||
&& buffer[ptr - 2] == TOKEN_MINUS)
|
||||
var = "-";
|
||||
|
||||
var += (char) b;
|
||||
@ -163,7 +164,7 @@ public class SubLine implements ApplesoftConstants
|
||||
if (!Utility.isLetter ((byte) var.charAt (0)))
|
||||
{
|
||||
if (is (TOKEN_GOTO) || is (TOKEN_GOSUB) || is (TOKEN_ON) || is (TOKEN_ONERR))
|
||||
return;
|
||||
return; // ignore line numbers
|
||||
addNumber (var);
|
||||
return;
|
||||
}
|
||||
|
@ -13,7 +13,6 @@ public class BasicPreferences
|
||||
public boolean onlyShowTargetLineNumbers = true;
|
||||
public boolean showCaret = false;
|
||||
public boolean showThen = true;
|
||||
public boolean listStrings = false;
|
||||
public boolean blankAfterReturn = false;
|
||||
public boolean deleteExtraRemSpace = false;
|
||||
public boolean deleteExtraDataSpace = false;
|
||||
@ -21,6 +20,7 @@ public class BasicPreferences
|
||||
public boolean showCalls = false;
|
||||
public boolean showSymbols = false;
|
||||
public boolean showConstants = false;
|
||||
// public boolean listStrings = false;
|
||||
public boolean showFunctions = false;
|
||||
public boolean showDuplicateSymbols = false;
|
||||
public boolean splitDim = false;
|
||||
@ -51,7 +51,7 @@ public class BasicPreferences
|
||||
text.append (String.format ("Show constants ........... %s%n", showConstants));
|
||||
text.append (String.format ("Show functions ........... %s%n", showFunctions));
|
||||
text.append (String.format ("Show duplicate symbols ... %s%n", showDuplicateSymbols));
|
||||
text.append (String.format ("List strings ............. %s%n", listStrings));
|
||||
// text.append (String.format ("List strings ............. %s%n", listStrings));
|
||||
text.append (String.format ("Blank after RETURN ....... %s%n", blankAfterReturn));
|
||||
text.append (String.format ("Delete extra REM space ... %s%n", deleteExtraRemSpace));
|
||||
text.append (String.format ("Delete extra DATA space .. %s%n", deleteExtraDataSpace));
|
||||
|
@ -60,7 +60,7 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
||||
private static final String PREFS_SHOW_CONSTANTS = "showConstants";
|
||||
private static final String PREFS_SHOW_FUNCTIONS = "showFunctions";
|
||||
private static final String PREFS_SHOW_DUPLICATE_SYMBOLS = "showDuplicateSymbols";
|
||||
private static final String PREFS_LIST_STRINGS = "listStrings";
|
||||
// private static final String PREFS_LIST_STRINGS = "listStrings";
|
||||
private static final String PREFS_BLANK_AFTER_RETURN = "blankAfterReturn";
|
||||
private static final String PREFS_DELETE_EXTRA_REM_SPACE = "deleteExtraRemSpace";
|
||||
private static final String PREFS_DELETE_EXTRA_DATA_SPACE = "deleteExtraDataSpace";
|
||||
@ -164,10 +164,10 @@ 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 literals");
|
||||
final JMenuItem showConstantsItem = new JCheckBoxMenuItem ("List constants");
|
||||
final JMenuItem showDuplicateSymbolsItem =
|
||||
new JCheckBoxMenuItem ("List duplicate variables");
|
||||
final JMenuItem listStringsItem = new JCheckBoxMenuItem ("List strings");
|
||||
// final JMenuItem listStringsItem = new JCheckBoxMenuItem ("List strings");
|
||||
|
||||
// Assembler menu items
|
||||
final JMenuItem showAssemblerTargetsItem = new JCheckBoxMenuItem ("Show targets");
|
||||
@ -276,7 +276,7 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
||||
applesoftMenu.add (showSymbolsItem);
|
||||
applesoftMenu.add (showFunctionsItem);
|
||||
applesoftMenu.add (showConstantsItem);
|
||||
applesoftMenu.add (listStringsItem);
|
||||
// applesoftMenu.add (listStringsItem);
|
||||
applesoftMenu.add (showDuplicateSymbolsItem);
|
||||
|
||||
assemblerMenu.add (showAssemblerHeaderItem);
|
||||
@ -292,9 +292,8 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
||||
alignAssignItem, showBasicTargetsItem, onlyShowTargetLinesItem, showCaretItem,
|
||||
showThenItem, blankAfterReturn, deleteExtraRemSpace, deleteExtraDataSpace));
|
||||
|
||||
applesoftXrefItems = new ArrayList (
|
||||
Arrays.asList (showXrefItem, showCallsItem, showSymbolsItem, showFunctionsItem,
|
||||
showConstantsItem, listStringsItem, showDuplicateSymbolsItem));
|
||||
applesoftXrefItems = new ArrayList (Arrays.asList (showXrefItem, showCallsItem,
|
||||
showSymbolsItem, showFunctionsItem, showConstantsItem, showDuplicateSymbolsItem));
|
||||
|
||||
ActionListener basicPreferencesAction = new ActionListener ()
|
||||
{
|
||||
@ -418,7 +417,7 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
||||
basicPreferences.showSymbols = showSymbolsItem.isSelected ();
|
||||
basicPreferences.showFunctions = showFunctionsItem.isSelected ();
|
||||
basicPreferences.showConstants = showConstantsItem.isSelected ();
|
||||
basicPreferences.listStrings = listStringsItem.isSelected ();
|
||||
// basicPreferences.listStrings = listStringsItem.isSelected ();
|
||||
basicPreferences.showDuplicateSymbols = showDuplicateSymbolsItem.isSelected ();
|
||||
|
||||
BasicProgram.setBasicPreferences (basicPreferences);
|
||||
@ -586,7 +585,7 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
||||
prefs.putBoolean (PREFS_SHOW_CONSTANTS, showConstantsItem.isSelected ());
|
||||
prefs.putBoolean (PREFS_SHOW_DUPLICATE_SYMBOLS,
|
||||
showDuplicateSymbolsItem.isSelected ());
|
||||
prefs.putBoolean (PREFS_LIST_STRINGS, listStringsItem.isSelected ());
|
||||
// prefs.putBoolean (PREFS_LIST_STRINGS, listStringsItem.isSelected ());
|
||||
prefs.putBoolean (PREFS_SHOW_TARGETS, showBasicTargetsItem.isSelected ());
|
||||
prefs.putBoolean (PREFS_ONLY_SHOW_TARGETS, onlyShowTargetLinesItem.isSelected ());
|
||||
prefs.putBoolean (PREFS_BLANK_AFTER_RETURN, blankAfterReturn.isSelected ());
|
||||
@ -647,7 +646,7 @@ class MenuHandler implements DiskSelectionListener, FileSelectionListener, QuitL
|
||||
showConstantsItem.setSelected (prefs.getBoolean (PREFS_SHOW_CONSTANTS, false));
|
||||
showDuplicateSymbolsItem
|
||||
.setSelected (prefs.getBoolean (PREFS_SHOW_DUPLICATE_SYMBOLS, false));
|
||||
listStringsItem.setSelected (prefs.getBoolean (PREFS_LIST_STRINGS, false));
|
||||
// listStringsItem.setSelected (prefs.getBoolean (PREFS_LIST_STRINGS, false));
|
||||
showBasicTargetsItem.setSelected (prefs.getBoolean (PREFS_SHOW_TARGETS, false));
|
||||
onlyShowTargetLinesItem
|
||||
.setSelected (prefs.getBoolean (PREFS_ONLY_SHOW_TARGETS, false));
|
||||
|
Loading…
x
Reference in New Issue
Block a user