Skip to content

Add LocalVariableNameFactory. #3271

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: 4.0.x
Choose a base branch
from
Open

Add LocalVariableNameFactory. #3271

wants to merge 2 commits into from

Conversation

christophstrobl
Copy link
Member

Add a variable name factory that considers predefined names and resolves name clashes.
Expose variable name clash resolution via the generation context of a single method.

Add a variable name factory that considers predefined names and resolves name clashes.
Expose variable name clash resolution via the generation context of a single method.
@christophstrobl christophstrobl marked this pull request as ready for review April 28, 2025 14:00
@christophstrobl christophstrobl assigned onobc and unassigned mp911de Apr 28, 2025
Copy link
Contributor

@onobc onobc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good @christophstrobl . I made a few minor suggestions. PTAL.

return new LocalVariableNameFactory(variables);
}

LocalVariableNameFactory(Iterable<String> predefinedVariableNames) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A simplification of this could be:

	LocalVariableNameFactory(Iterable<String> predefinedVariableNames) {
		predefinedVariableNames.forEach((paramName) -> variables.put(paramName, 0L));
	}

Wdyt?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants