1
0
Fork 0
mirror of https://github.com/beefytech/Beef.git synced 2025-06-19 08:30:25 +02:00

Got rid of Action<T>/Func<T>

This commit is contained in:
Brian Fiete 2020-05-08 07:10:35 -07:00
parent 44bd9c698f
commit b52db47d55
37 changed files with 94 additions and 88 deletions

View file

@ -301,6 +301,7 @@ namespace IDE.Compiler
BfPassInstance passInstance = null;
bool didPassInstanceAlloc = false;
bool wantsRemoveOldData = false;
mBfSystem.Lock(0);
@ -488,8 +489,7 @@ namespace IDE.Compiler
QueueDeferredResolveAll();
delete resolvePassData;
mBfSystem.RemoveOldParsers();
mBfSystem.RemoveOldData();
wantsRemoveOldData = true;
passKind = .Classify;
// End after resolveAll
@ -520,6 +520,12 @@ namespace IDE.Compiler
gApp.mErrorsPanel.ProcessPassInstance(passInstance, passKind);
delete passInstance;
}
if (wantsRemoveOldData)
{
mBfSystem.RemoveOldParsers();
mBfSystem.RemoveOldData();
}
}
void HandleOptions(BfProject hotBfProject, int32 hotIdx)

View file

@ -558,7 +558,7 @@ namespace IDE
#endif
}
public void Update(Action<String, String, WatcherChangeTypes> fileChangeHandler = null)
public void Update(delegate void(String, String, WatcherChangeTypes) fileChangeHandler = null)
{
while (true)
{

View file

@ -209,7 +209,7 @@ namespace IDE
public Targets mTargets = new Targets() ~ delete _;
public DebugManager mDebugger ~ delete _;
public String mSymSrvStatus = new String() ~ delete _;
public Action<String> mPendingDebugExprHandler = null;
public delegate void(String) mPendingDebugExprHandler = null;
public bool mIsImmediateDebugExprEval;
public BookmarkManager mBookmarkManager = new BookmarkManager() ~ delete _;
public HistoryManager mHistoryManager = new HistoryManager() ~ delete _;
@ -435,9 +435,9 @@ namespace IDE
public String mTempFileName ~ delete _;
public int32 mParallelGroup = -1;
public Task<String> mReadTask /*~ delete _*/;
public Action<Task<String>> mOnReadTaskComplete /*~ delete _*/;
public delegate void(Task<String>) mOnReadTaskComplete /*~ delete _*/;
public Task<String> mErrorTask /*~ delete _*/;
public Action<Task<String>> mOnErrorTaskComplete /*~ delete _*/;
public delegate void(Task<String>) mOnErrorTaskComplete /*~ delete _*/;
public Monitor mMonitor = new Monitor() ~ delete _;
public String mStdInData ~ delete _;
@ -5243,7 +5243,7 @@ namespace IDE
});
}
public void WithDocumentTabbedViews(Action<DarkTabbedView> func)
public void WithDocumentTabbedViews(delegate void(DarkTabbedView) func)
{
for (int32 windowIdx = 0; windowIdx < mWindows.Count; windowIdx++)
{
@ -5347,7 +5347,7 @@ namespace IDE
return null;
}
public void WithTabs(Action<TabbedView.TabButton> func)
public void WithTabs(delegate void(TabbedView.TabButton) func)
{
WithDocumentTabbedViews(scope (documentTabbedView) =>
{
@ -5366,7 +5366,7 @@ namespace IDE
return tab;
}
public void WithSourceViewPanels(Action<SourceViewPanel> func)
public void WithSourceViewPanels(delegate void(SourceViewPanel) func)
{
WithTabs(scope (tab) =>
{
@ -5839,7 +5839,7 @@ namespace IDE
if (showType != SourceShowType.New)
{
Action<TabbedView.TabButton> tabFunc = scope [&] (tabButton) =>
delegate void(TabbedView.TabButton) tabFunc = scope [&] (tabButton) =>
{
var darkTabButton = (DarkTabbedView.DarkTabButton)tabButton;
if (tabButton.mContent is SourceViewPanel)
@ -10866,7 +10866,8 @@ namespace IDE
Pending
}
public EvalResult DebugEvaluate(String expectedType, String expr, String outVal, int cursorPos = -1, DebugManager.Language language = .NotSet, DebugManager.EvalExpressionFlags expressionFlags = .None, Action<String> pendingHandler = null)
public EvalResult DebugEvaluate(String expectedType, String expr, String outVal, int cursorPos = -1, DebugManager.Language language = .NotSet,
DebugManager.EvalExpressionFlags expressionFlags = .None, delegate void(String) pendingHandler = null)
{
defer
{

View file

@ -2184,7 +2184,7 @@ namespace IDE
}
public void WithProjectItems(Action<ProjectItem> func)
public void WithProjectItems(delegate void(ProjectItem) func)
{
List<int32> idxStack = scope List<int32>();
List<ProjectFolder> folderStack = scope List<ProjectFolder>();

View file

@ -1027,7 +1027,7 @@ namespace IDE
}
}
public void WithProjectItems(Action<ProjectItem> func)
public void WithProjectItems(delegate void(ProjectItem) func)
{
for (var project in mProjects)
{

View file

@ -60,7 +60,7 @@ namespace IDE.ui
public String mPendingEvalStr ~ delete _;
public String mCurEvalExpr ~ delete _;
public Breakpoint mPendingMemoryBreakpoint ~ { if (_ != null) _.Deref(); };
public Action<int, int, String> mOnPendingMemoryBreakpoint ~ delete _;
public delegate void(int, int, String) mOnPendingMemoryBreakpoint ~ delete _;
public this()
{
@ -488,7 +488,7 @@ namespace IDE.ui
return true;
}
public MemoryBreakpointResult TryCreateMemoryBreakpoint(String evalStr, out int addr, out int32 byteCount, String addrType, Action<int, int, String> pendingHandler)
public MemoryBreakpointResult TryCreateMemoryBreakpoint(String evalStr, out int addr, out int32 byteCount, String addrType, delegate void(int, int, String) pendingHandler)
{
addr = 0;
byteCount = 0;

View file

@ -427,7 +427,7 @@ namespace IDE.ui
Menu menu = new Menu();
Action<String, bool> addSubMenu = scope (label, useRepType) => {
delegate void(String, bool) addSubMenu = scope (label, useRepType) => {
Menu subMenu = menu.AddItem(label);

View file

@ -17,7 +17,7 @@ namespace IDE.ui
mIsReadOnly = true;
}
public Event<Func<int, int, bool>> mGotoReferenceEvent ~ _.Dispose();
public Event<delegate bool(int, int)> mGotoReferenceEvent ~ _.Dispose();
public bool GotoRefrenceAtLine(int line, int lineOfs = 0)
{
//bool selectLine = true;

View file

@ -177,10 +177,10 @@ namespace IDE.ui
OnlyShowInvoke = 4
}
public Action<char32, AutoCompleteOptions> mOnGenerateAutocomplete ~ delete _;
public delegate void(char32, AutoCompleteOptions) mOnGenerateAutocomplete ~ delete _;
public Action mOnFinishAsyncAutocomplete ~ delete _;
public Action mOnCancelAsyncAutocomplete ~ delete _;
public Func<bool> mOnEscape ~ delete _; // returns 'true' if did work
public delegate bool() mOnEscape ~ delete _; // returns 'true' if did work
public AutoComplete mAutoComplete ~ delete _;
List<QueuedTextEntry> mQueuedText = new List<QueuedTextEntry>() ~ delete _;
List<QueuedUnderlineEntry> mQueuedUnderlines = new List<QueuedUnderlineEntry>() ~ delete _;

View file

@ -6641,7 +6641,7 @@ namespace IDE.ui
}
public void WithTrackedElementsAtCursor<T>(List<T> trackedElementList, Action<T> func) where T : TrackedTextElement
public void WithTrackedElementsAtCursor<T>(List<T> trackedElementList, delegate void(T) func) where T : TrackedTextElement
{
int lineIdx;
int lineCharIdx;

View file

@ -2800,7 +2800,7 @@ namespace IDE.ui
}
}
void WithSelected(Action<ListViewItem> func)
void WithSelected(delegate void(ListViewItem) func)
{
var root = listView.GetRoot();
root.WithSelectedItems(func, false, true);