* Move yield string constants to StringConstants class * Add GeneratedNamesManager class to store all generated names during unit compilation * Make GeneratedNamesManager class non static * Add Utils project to installer files * Add GeneratedNamesManager usage in CapturedVariablesSubstitutionsManager * Move GeneratedNamesManager initialization in CompilationUnit constructor * More GeneratedNamesManager usage * QuestionPointDesugarVisitor fix
26 lines
903 B
C#
26 lines
903 B
C#
// Copyright (c) Ivan Bondarev, Stanislav Mikhalkovich (for details please see \doc\copyright.txt)
|
|
// This code is distributed under the GNU LGPL (for details please see \doc\license.txt)
|
|
using System.Collections.Generic;
|
|
using PascalABCCompiler;
|
|
using PascalABCCompiler.SyntaxTree;
|
|
using PascalABCCompiler.CoreUtils;
|
|
|
|
namespace Languages.Pascal.Frontend.Core
|
|
{
|
|
public class ParserLambdaHelper
|
|
{
|
|
private readonly GeneratedNamesManager generatedNamesManager = new GeneratedNamesManager();
|
|
public List<function_lambda_definition> lambdaDefinitions = new List<function_lambda_definition>();
|
|
|
|
public string CreateLambdaName()
|
|
{
|
|
return generatedNamesManager.GenerateName(StringConstants.lambdaPrefix);
|
|
}
|
|
|
|
public bool IsLambdaName(ident id)
|
|
{
|
|
return id.name.StartsWith(StringConstants.lambdaPrefix);
|
|
}
|
|
}
|
|
}
|