merge
This commit is contained in:
parent
564ece3614
commit
733c9e80e5
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "9";
|
||||
public const string Build = "0";
|
||||
public const string Revision = "3417";
|
||||
public const string Revision = "3418";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%MINOR%=9
|
||||
%REVISION%=3417
|
||||
%COREVERSION%=0
|
||||
%REVISION%=3418
|
||||
%MINOR%=9
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1 +1 @@
|
|||
3.9.0.3417
|
||||
3.9.0.3418
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.9.0.3417'
|
||||
!define VERSION '3.9.0.3418'
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ namespace PascalABCCompiler.SyntaxTreeConverters
|
|||
// stat.ProcessNode(root);
|
||||
#endif
|
||||
// SSM 02.01.24
|
||||
LetExprVisitor.New.ProcessNode(root);
|
||||
//LetExprVisitor.New.ProcessNode(root);
|
||||
|
||||
// new range - до всего! До выноса выражения с лямбдой из foreach. 11.07 добавил поиск yields и присваивание pd.HasYield
|
||||
NewRangeDesugarAndFindHasYieldVisitor.New.ProcessNode(root);
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ begin
|
|||
end;
|
||||
'Min3': begin
|
||||
CheckData(InitialInput := |cRe|*3);
|
||||
Generatetests(10,tRe(1,100)*2);
|
||||
Generatetests(10,tRe(1,100)*3);
|
||||
CheckOutput(Min(Re(0),Re(1),Re(2)));
|
||||
end;
|
||||
'SeriesMin2': begin
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ begin
|
|||
end;
|
||||
'Insert2': begin
|
||||
CheckData(Input := Empty);
|
||||
CheckOutput('Петр первый был великим русским императором');
|
||||
CheckOutput('Петр Первый был великим русским императором');
|
||||
end;
|
||||
'StrChange1': begin
|
||||
CheckData(Input := Empty);
|
||||
|
|
@ -306,7 +306,7 @@ begin
|
|||
end;
|
||||
'StrSlice2': begin
|
||||
CheckData(Input := Empty);
|
||||
CheckOutputSeq(Arr('клад зарыт на юго западе', 'клад зарыт на юго западе'));
|
||||
CheckOutputSeq(Arr('клад зарыт на юго западе', 'зашифрованное сообщение'));
|
||||
end;
|
||||
'StrSlice4': begin
|
||||
CheckData(Input := Empty);
|
||||
|
|
|
|||
|
|
@ -95,6 +95,18 @@ namespace TreeConverter.LambdaExpressions.Closure
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// SSM 2024.01.09
|
||||
public override void visit(let_var_expr letVarExpr)
|
||||
{
|
||||
ProcessNode(letVarExpr.ex);
|
||||
|
||||
_visitor.ProcessNode(letVarExpr);
|
||||
|
||||
SymbolInfo si = _visitor.context.find_first(letVarExpr.id.name);
|
||||
_currentTreeNode.VariablesDefinedInScope.Add(new CapturedVariablesTreeNode.CapturedSymbolInfo(letVarExpr, si));
|
||||
}
|
||||
|
||||
public override void visit(statement_list stmtList)
|
||||
{
|
||||
if (stmtList.IsInternal) // просто обойти как продолжение объемлющего statement_list
|
||||
|
|
|
|||
|
|
@ -19807,6 +19807,36 @@ namespace PascalABCCompiler.TreeConverter
|
|||
ret.reset(); // SSM 19.01.17 не возвращать семантическое значение т.к. ничего не нужно добавлять в текущий список операторов!!
|
||||
}
|
||||
|
||||
// создать словарик чтобы для одного _visitor.context.CurrentScope.ScopeNum и для одного letVarExpr
|
||||
// мы заходили в этот visit один раз
|
||||
private Dictionary<let_var_expr, List<int>> letDict = new Dictionary<let_var_expr, List<int>>();
|
||||
|
||||
// можно попробовать в одно ПИ не добавлять дважды - хранить словарь (let-переменная, номера ПИ в кот добавлена)
|
||||
public override void visit(SyntaxTree.let_var_expr let_expr)
|
||||
{
|
||||
if (letDict.ContainsKey(let_expr) && letDict[let_expr].Contains(context.CurrentScope.ScopeNum))
|
||||
return;
|
||||
|
||||
if (!letDict.ContainsKey(let_expr))
|
||||
letDict[let_expr] = new List<int>();
|
||||
letDict[let_expr].Add(context.CurrentScope.ScopeNum);
|
||||
|
||||
var exn = (expression_node)convert_strong(let_expr.ex);
|
||||
var sav = new semantic_addr_value(exn);
|
||||
var vds = new var_statement(let_expr.id, sav, let_expr.source_context);
|
||||
if (let_expr.visit_var)
|
||||
{
|
||||
visit(vds.var_def);
|
||||
//let_expr.visit_var = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
}
|
||||
return_value(exn);
|
||||
}
|
||||
|
||||
|
||||
public override void visit(SyntaxTree.expression_as_statement node)
|
||||
{
|
||||
return_value((statement_node)convert_strong(node.expr));
|
||||
|
|
|
|||
|
|
@ -528,7 +528,7 @@ begin
|
|||
end;
|
||||
'Min3': begin
|
||||
CheckData(InitialInput := |cRe|*3);
|
||||
Generatetests(10,tRe(1,100)*2);
|
||||
Generatetests(10,tRe(1,100)*3);
|
||||
CheckOutput(Min(Re(0),Re(1),Re(2)));
|
||||
end;
|
||||
'SeriesMin2': begin
|
||||
|
|
|
|||
|
|
@ -282,7 +282,7 @@ begin
|
|||
end;
|
||||
'Insert2': begin
|
||||
CheckData(Input := Empty);
|
||||
CheckOutput('Петр первый был великим русским императором');
|
||||
CheckOutput('Петр Первый был великим русским императором');
|
||||
end;
|
||||
'StrChange1': begin
|
||||
CheckData(Input := Empty);
|
||||
|
|
@ -306,7 +306,7 @@ begin
|
|||
end;
|
||||
'StrSlice2': begin
|
||||
CheckData(Input := Empty);
|
||||
CheckOutputSeq(Arr('клад зарыт на юго западе', 'клад зарыт на юго западе'));
|
||||
CheckOutputSeq(Arr('клад зарыт на юго западе', 'зашифрованное сообщение'));
|
||||
end;
|
||||
'StrSlice4': begin
|
||||
CheckData(Input := Empty);
|
||||
|
|
|
|||
Loading…
Reference in a new issue