Skip to content

Introduce parseCommaSeparatedList - #141

Merged
makenowjust merged 2 commits into
mainfrom
comma-sep-list
Oct 18, 2024
Merged

Introduce parseCommaSeparatedList#141
makenowjust merged 2 commits into
mainfrom
comma-sep-list

Conversation

@makenowjust

Copy link
Copy Markdown
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
@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