Skip to content
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

Introduce parseCommaSeparatedList #141

Merged
merged 2 commits into from
Oct 18, 2024
Merged

Introduce parseCommaSeparatedList #141

merged 2 commits into from
Oct 18, 2024

Conversation

makenowjust
Copy link
Collaborator

Discussed in #111 (comment)

This PR introduces a new function parseCommaSeparatedList. This function is a replacement of the following idiom to parse comma separated list:

	xxxs := []*ast.XXX{p.parseXXX()}
	for p.Token.Kind == "," {
		p.nextToken()
		xxxs = append(xxxs, p.parseXXX())
	}

In fact, this PR reduces about 60 lines of code.

@makenowjust makenowjust merged commit 5c08e76 into main Oct 18, 2024
4 checks passed
@makenowjust makenowjust deleted the comma-sep-list branch October 18, 2024 05:59
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.

2 participants