Request for feedback: Parsing Advent of Code #399
Replies: 1 comment
-
Hi 👋, thanks for the kind words.
With the default lexer (see text/scanner for more detail),
The tutorial shows how I would typically build a parser iteratively, however I will usually incrementally build it up and let it fail. The failure tells me that there's still work to do. If you want it to succeed, you can match all remaining tokens with something like
Nothing specific no. The grammar is based on EBNF, so any general parsing resource will usually cover it. All the best, |
Beta Was this translation helpful? Give feedback.
-
Hello!
Thank you for this parser! I am just learning how to use it and I wanted some feedback on a recent practice I did.
I tried parse an advent of code problem's input using participle. I'm not sure I did it quite right 😅
My code for parsing is here: https://github.com/nicolecomputer/go-practice/blob/main/parse-aoc-23-02/main.go
A couple of questions:
@String
and sometimes I want to use@Ident
. How do I know when to use each?Game 1: red 10, blue 3; green 1
and at first I wanted to pull a struct with justGame 1
andred 10, blue 3; green 1
but I couldn't figure out how to suck up those stringsI'm really grateful for the care that you've put into the library (just seeing a tutorial linked at the top made me SO happy 💖 💖 💖 )
🍃 Nicole
Beta Was this translation helpful? Give feedback.
All reactions