-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: parser state machine #4
Conversation
6c00d1b
to
7c42e5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
appreciate the comments, looks like a good testin flow
circuits/test/parser.test.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, looks like a good test flow
pragma circom 2.1.9; | ||
|
||
include "operators.circom"; | ||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good notes
@thor314 thank ser |
Alright the above two tasks are pretty much done for simpler JSON. Where I am at with this now is I have created a few circuits. They are in
circuits.json
whichcircomkit
uses to do some automations with them! I found this quite helpful.What I was working with in particular was
test_extract
which digests thejson_examples/test.json
. To try this out, run:and you should see some logs appear (note, follow README instructions to get
circomkit
up and running). These logs track the state of theParser
component you'll find incircuits/extract.circom
andcircuits/parser.circom
.I left notes in
circuits/parser.circom
that walk through expected states we see given what we have just read at a given byte index. You can validate yourself by clicking throughtest.json
.Nonetheless, you should get code that verifies this witness meaning that, in some sense, it is valid JSON! Also, we have marked where the keys are by enabling the
inside_key
bit and marked where values are by enabling theinside_value
bit.Output would look like this 😄:
There are next steps. So I have other JSON there to test the limits of this. Also, I should write some tests on valid state transitions for the parser. I did not do this yet. Please hold me accountable and make sure I make issues for these things.
Signing off for now. Gn.