2019-07-28 23:53:15 +03:00
|
|
|
|
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
|
2015-06-02 22:52:35 +03:00
|
|
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
2015-05-14 22:35:07 +03:00
|
|
|
|
using System.Collections.Generic;
|
2026-03-08 18:30:33 +03:00
|
|
|
|
using PascalABCCompiler;
|
2015-05-14 22:35:07 +03:00
|
|
|
|
using PascalABCCompiler.SyntaxTree;
|
2026-03-08 18:30:33 +03:00
|
|
|
|
using PascalABCCompiler.CoreUtils;
|
2015-05-14 22:35:07 +03:00
|
|
|
|
|
2024-05-25 12:26:32 +03:00
|
|
|
|
namespace Languages.Pascal.Frontend.Core
|
2015-05-14 22:35:07 +03:00
|
|
|
|
{
|
|
|
|
|
|
public class ParserLambdaHelper
|
|
|
|
|
|
{
|
2026-03-08 18:30:33 +03:00
|
|
|
|
private readonly GeneratedNamesManager generatedNamesManager = new GeneratedNamesManager();
|
|
|
|
|
|
public List<function_lambda_definition> lambdaDefinitions = new List<function_lambda_definition>();
|
2015-05-14 22:35:07 +03:00
|
|
|
|
|
|
|
|
|
|
public string CreateLambdaName()
|
|
|
|
|
|
{
|
2026-03-08 18:30:33 +03:00
|
|
|
|
return generatedNamesManager.GenerateName(StringConstants.lambdaPrefix);
|
2015-05-14 22:35:07 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public bool IsLambdaName(ident id)
|
|
|
|
|
|
{
|
2026-03-08 18:30:33 +03:00
|
|
|
|
return id.name.StartsWith(StringConstants.lambdaPrefix);
|
2015-05-14 22:35:07 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|