Skip to content

Commit

Permalink
When the sample is executed, btnRun is disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
yallie committed Mar 11, 2018
1 parent 887bba7 commit ca08c39
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 16 deletions.
23 changes: 11 additions & 12 deletions Irony.GrammarExplorer/fmGrammarExplorer.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Irony.GrammarExplorer/fmGrammarExplorer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ private void fmExploreGrammar_Load(object sender, EventArgs e) {
chkDisableHili.Checked = Settings.Default.DisableHili;
chkAutoRefresh.Checked = Settings.Default.AutoRefresh;
cboGrammars.SelectedIndex = Settings.Default.LanguageIndex; //this will build parser and start colorizer
if (Application.RenderWithVisualStyles)
splitRight.BackColor = SystemColors.ControlLightLight;
} catch { }
_loaded = true;
}
Expand Down Expand Up @@ -361,6 +363,9 @@ private void RunSample() {
ParseSample();
if (_parseTree.ParserMessages.Count > 0) return;

//show output console
tabBottom.SelectedTab = pageOutput;
btnRun.Enabled = false;
GC.Collect(); //to avoid disruption of perf times with occasional collections
oldGcCount = GC.CollectionCount(0);
System.Threading.Thread.Sleep(100);
Expand All @@ -374,11 +379,11 @@ private void RunSample() {
var gcCount = GC.CollectionCount(0) - oldGcCount;
lblGCCount.Text = gcCount.ToString();
WriteOutput(output);
tabBottom.SelectedTab = pageOutput;
} catch (ScriptException ex) {
ShowRuntimeError(ex);
} finally {
sw.Stop();
btnRun.Enabled = true;
}//finally
}//method

Expand Down
7 changes: 4 additions & 3 deletions Languages/Refal/Runtime/RefalLibrary.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using Irony.Interpreter.Ast;
using Irony.Interpreter;
using System.Numerics;
using System.Collections.Concurrent;

namespace Refal.Runtime
{
Expand Down Expand Up @@ -43,9 +44,9 @@ public class RefalLibrary
public RefalLibrary(ScriptThread thread)
{
ScriptThread = thread;
OpenFiles = new Dictionary<string, object>();
BuriedKeys = new Dictionary<string, PassiveExpression>();
BuriedValues = new Dictionary<string, PassiveExpression>();
OpenFiles = new ConcurrentDictionary<string, object>();
BuriedKeys = new ConcurrentDictionary<string, PassiveExpression>();
BuriedValues = new ConcurrentDictionary<string, PassiveExpression>();
CommandLineArguments = null;
}

Expand Down

0 comments on commit ca08c39

Please sign in to comment.