bug fix issue #60

This commit is contained in:
Бондарев Иван 2016-02-04 22:05:20 +01:00
parent 8258c8a990
commit 3333c549a1
2 changed files with 10 additions and 3 deletions

View file

@ -662,9 +662,15 @@ namespace TreeConverter.LambdaExpressions.Closure
{
_visitor.context.SaveContextAndUpToGlobalLevel();
_visitor.lambdaProcessingState = LambdaProcessingState.ClosuresProcessingVisitGeneratedClassesPhase;
procedures.ForEach(p => _visitor.visit(p));
_visitor.context.RestoreCurrentContext();
_visitor.lambdaProcessingState = LambdaProcessingState.ClosuresProcessingPhase;
try
{
procedures.ForEach(p => _visitor.visit(p));
}
finally
{
_visitor.context.RestoreCurrentContext();
_visitor.lambdaProcessingState = LambdaProcessingState.ClosuresProcessingPhase;
}
}
private void SubstituteVarDefInProcedure(statement_list statementList) //TODO: сейчас обрабатывается так, как будто блока объявлений declarations в функции нет. Нужно будет предусмотреть, но не только для функций, а еще для всех узлов где есть block, который содержит declarations

View file

@ -18047,6 +18047,7 @@ namespace PascalABCCompiler.TreeConverter
el.expressions.Add(new SyntaxTree.ident(_function_lambda_call.f_lambda_def.formal_parameters.params_list[i].idents.idents[0].name, _function_lambda_call.source_context));
}
SyntaxTree.method_call _method_call = new SyntaxTree.method_call(el);
_method_call.source_context = _function_lambda_call.source_context;
if (_method_call is SyntaxTree.dereference)
{
((SyntaxTree.dereference)_method_call).dereferencing_value = (SyntaxTree.addressed_value)(new SyntaxTree.ident(_function_lambda_call.f_lambda_def.lambda_name, _function_lambda_call.source_context));