Compare commits

...

2 commits

Author SHA1 Message Date
Александр Погорелов b013f24d12 Изменен порядок обхода для срезов 2020-05-05 15:44:11 +03:00
Александр Погорелов 1313d75374 -1 теперь корректный to для SystemSlice 2020-05-05 12:10:40 +03:00
2 changed files with 15 additions and 10 deletions

View file

@ -59,24 +59,29 @@ namespace SyntaxVisitors.SugarVisitors
el.Add(sl.step);
return el;
}
/*
public override void Exit(syntax_tree_node st)
{
if (st is slice_expr_question)
{
ProceedSliceQuestionExpr(st as slice_expr_question);
} else if (st is slice_expr)
{
ProceedSliceExpr(st as slice_expr);
}
// base.Exit(st);
}
else if (st is slice_expr)
{
ProceedSliceExpr(st as slice_expr);
} else
{
base.Exit(st);
}
}*/
public override void visit(assign _assign)
{
Exit(_assign.from);
Exit(_assign.to);
_assign.from.visit(this);
_assign.to.visit(this);
}
public void ProceedSliceExpr(slice_expr sl)
public override void visit(slice_expr sl)
{
var el = construct_expression_list_for_slice_expr(sl);
if (sl.Parent is assign parent_assign && parent_assign.to == sl)
@ -104,7 +109,7 @@ namespace SyntaxVisitors.SugarVisitors
}
}
public void ProceedSliceQuestionExpr(slice_expr_question sl)
public override void visit(slice_expr_question sl)
{
if (sl.Parent is assign parent_assign && parent_assign.to == sl)
{

View file

@ -10444,7 +10444,7 @@ begin
raise new ArgumentException(GetTranslation(PARAMETER_FROM_OUT_OF_RANGE));
if (situation = 0) or (situation = 1) then
if (&to < 0) or (&to > Len) then
if (&to < -1) or (&to > Len) then
raise new ArgumentException(GetTranslation(PARAMETER_TO_OUT_OF_RANGE));
if situation > 0 then