This commit is contained in:
Бондарев Иван 2017-08-13 13:32:28 +02:00
parent e453584d3c
commit 774a1a2706
7 changed files with 29 additions and 18 deletions

View file

@ -5581,7 +5581,10 @@ namespace PascalABCCompiler.NETGenerator
il.Emit(OpCodes.Brfalse, FalseLabel);
labels.Push(FalseLabel);//break
clabels.Push(TrueLabel);//continue
bool tmp_lb = gen_left_brackets;
gen_left_brackets = false;
ConvertStatement(value.body);
gen_left_brackets = tmp_lb;
il.Emit(OpCodes.Br, TrueLabel);
il.MarkLabel(FalseLabel);
clabels.Pop();

View file

@ -1047,6 +1047,21 @@ namespace PascalABCCompiler
private void VisitCommonNamespaceFunctionCall(common_namespace_function_call en)
{
CheckInfiniteRecursion(en);
if ((en.function_node.name == "Reset" || en.function_node.name == "Rewrite" || en.function_node.name == "Assign") && en.function_node.comprehensive_namespace.namespace_name == "PABCSystem")
{
expression_node p = en.parameters[0];
switch (p.semantic_node_type)
{
case semantic_node_type.local_variable_reference: IncreaseNumAssVar((local_variable_reference)p); break;
case semantic_node_type.local_block_variable_reference: IncreaseNumAssVar((local_block_variable_reference)p); break;
case semantic_node_type.namespace_variable_reference: IncreaseNumAssVar((namespace_variable_reference)p); break;
case semantic_node_type.class_field_reference: VisitExpression((p as class_field_reference).obj); IncreaseNumAssField((class_field_reference)p); break;
case semantic_node_type.static_class_field_reference: IncreaseNumAssField((static_class_field_reference)p); break;
case semantic_node_type.common_parameter_reference: IncreaseNumAssParam((common_parameter_reference)p); break;
case semantic_node_type.deref_node: CheckAssign(((dereference_node)p).deref_expr); break;
case semantic_node_type.simple_array_indexing: VisitSimpleArrayIndexing((simple_array_indexing)p); break;
}
}
for (int i = 0; i < en.parameters.Count; i++)
{
CheckVarParameter(en.parameters[i], en.function_node, i);

View file

@ -3951,7 +3951,7 @@ begin
_MainForm.ClientSize := new Size(defaultWindowWidth, defaultWindowHeight);
_MainForm.BackColor := Color.White;
_MainForm.Controls.Add(f);
_MainForm.TopMost := True;
//_MainForm.TopMost := True;
_MainForm.StartPosition := FormStartPosition.CenterScreen;
_MainForm.FormClosing += f.OnClosing;
// Поле ввода

View file

@ -302,7 +302,7 @@ namespace VisualPascalABC
private bool MustDebug = false;
public bool IsRunning = false;
public string ExeFileName;
public bool show_debug_tabs=true;
public bool ShowDebugTabs=true;
public PascalABCCompiler.Parsers.IParser parser = null;
EventHandler<EventArgs> debuggerStateEvent;
@ -606,7 +606,7 @@ namespace VisualPascalABC
if (Exited != null && ExeFileName != null)
Exited(ExeFileName);
curPage = null;
show_debug_tabs = true;
ShowDebugTabs = true;
workbench.WidgetController.SetPlayButtonsVisible(false);
workbench.WidgetController.SetAddExprMenuVisible(false);
workbench.WidgetController.SetDisassemblyMenuVisible(false);
@ -663,9 +663,6 @@ namespace VisualPascalABC
TooltipServiceManager.hideToolTip();
IsRunning = true;
evaluator = new ExpressionEvaluator(e.Process,workbench.VisualEnvironmentCompiler, FileName);
//CodeFileDocumentControl page = frm.CurrentTabPage;
//(page.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.TextArea.ToolTipRequest += TextAreaToolTipRequest;
//(page.ag as CodeFileDocumentControl).TextEditor.ActiveTextAreaControl.TextArea.MouseLeave += TextAreaMouseLeave;
}
/// <summary>
@ -812,9 +809,9 @@ namespace VisualPascalABC
string save_PrevFullFileName = PrevFullFileName;
//CodeFileDocumentControl page = null;
//DebuggerService.JumpToCurrentLine(nextStatement.SourceFullFilename, nextStatement.StartLine, nextStatement.StartColumn, nextStatement.EndLine, nextStatement.EndColumn);
if (!show_debug_tabs)//esli eshe ne pokazany watch i lokal, pokazyvaem
if (!ShowDebugTabs)//esli eshe ne pokazany watch i lokal, pokazyvaem
{
show_debug_tabs = true;
ShowDebugTabs = true;
workbench.WidgetController.SetDebugTabsVisible(true);
workbench.WidgetController.SetAddExprMenuVisible(true);
}
@ -834,7 +831,7 @@ namespace VisualPascalABC
return;
}
else if (is_out == true)
else if (is_out)
{
is_out = false;
if (stepin_stmt.SourceFullFilename == debuggedProcess.NextStatement.SourceFullFilename && stepin_stmt.StartLine != debuggedProcess.NextStatement.StartLine)
@ -1090,10 +1087,6 @@ namespace VisualPascalABC
public string GetVariable(TextArea textArea, out int num_line)
{
IDocument doc = textArea.Document;
/*LineSegment seg = doc.GetLineSegment(logicPos.Y);
num_line = seg.LineNumber;
if (logicPos.X > seg.Length - 1)
return null;*/
string textContent = doc.TextContent;
num_line = textArea.Caret.Line;
int start_off = 0;

View file

@ -150,13 +150,13 @@ namespace VisualPascalABC
BuildService.CompilerOptions.ForDebugging = false;
if (startWithGoto)
{
DebuggerManager.show_debug_tabs = true;
DebuggerManager.ShowDebugTabs = true;
DebuggerManager.CurrentBreakpoint = DebuggerManager.AddBreakPoint(DocumentService.CurrentCodeFileDocument.FileName, DocumentService.CurrentCodeFileDocument.TextEditor.ActiveTextAreaControl.Caret.Line + 1, false);
DebuggerManager.AddGoToBreakPoint(DebuggerManager.CurrentBreakpoint);
}
else if (needFirstBreakpoint)
{
DebuggerManager.show_debug_tabs = true;
DebuggerManager.ShowDebugTabs = true;
if (Workbench.VisualEnvironmentCompiler.Compiler.VarBeginOffset != 0)
{
DebuggerManager.SetFirstBreakpoint(tabPage.FileName, Workbench.VisualEnvironmentCompiler.Compiler.VarBeginOffset);
@ -166,7 +166,7 @@ namespace VisualPascalABC
DebuggerManager.SetFirstBreakpoint(tabPage.FileName, Workbench.VisualEnvironmentCompiler.Compiler.BeginOffset);
}
else
DebuggerManager.show_debug_tabs = false;
DebuggerManager.ShowDebugTabs = false;
}
RunActiveTabPage = false;
try

View file

@ -624,7 +624,7 @@ namespace VisualPascalABC
{
watch_vis = true;
}
if (WorkbenchServiceFactory.DebuggerManager.show_debug_tabs)
if (WorkbenchServiceFactory.DebuggerManager.ShowDebugTabs)
{
if (!BottomTabsVisible)
BottomTabsVisible = true;

View file

@ -478,7 +478,7 @@ namespace VisualPascalABC
tp.Text += string.Format(" [{0}]", PascalABCCompiler.StringResources.Get("VP_MF_FROM_METADATA"));
if (!ProjectFactory.Instance.ProjectLoaded && !tp.FromMetadata)
{
if (tp.Run && (!WorkbenchServiceFactory.DebuggerManager.IsRun(tp.EXEFileName) || !WorkbenchServiceFactory.DebuggerManager.show_debug_tabs))
if (tp.Run && (!WorkbenchServiceFactory.DebuggerManager.IsRun(tp.EXEFileName) || !WorkbenchServiceFactory.DebuggerManager.ShowDebugTabs))
tp.Text += string.Format(" [{0}]", PascalABCCompiler.StringResources.Get("VP_MF_TS_RUN"));
else
if (WorkbenchServiceFactory.DebuggerManager.IsRun(tp.EXEFileName, tp.FileName))