Skip to content

How to include braces only when "more than one" #199

Answered by asmaloney
asmaloney asked this question in Q&A
Discussion options

You must be logged in to vote

Ah, well. I was missing parens in the pattern. So it needs to look like this:

FooList []*foo `parser:"( '{' @@+ '} | @@ )'"`

That took far longer than it should have 😄

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by asmaloney
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #198 on October 30, 2021 20:29.