Replies: 2 comments 2 replies
-
I would probably structure this like so: type Search struct {
Entry []*Entry `@@*`
}
type Entry struct {
Field *Field ` @@`
String *string `| @String`
Value *string `| @Ident`
} |
Beta Was this translation helpful? Give feedback.
1 reply
-
That is exactly the pointer I needed, thanks @alecthomas! |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello,
Thank you so much for this project. I've read the examples and docs but I seem to be tripping up when I want to parse strings like this:
key:value another:value some remaining search text
key:value another:value "quoted text"
Where I want the non key values to be an array of strings (or in the case of the quoted string just one item).
I've been using this syntax:
But I seem to be able to trip it up when a quote is used, as it doesn't seem to generate an invalid symbol.
Beta Was this translation helpful? Give feedback.
All reactions