Skip to content

Commit

Permalink
changeable stack height
Browse files Browse the repository at this point in the history
  • Loading branch information
Autoparallel committed Aug 13, 2024
1 parent e4e256b commit ccb86bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
15 changes: 10 additions & 5 deletions circuits.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,40 @@
"file": "extract",
"template": "Extract",
"params": [
157
157,
13
]
},
"value_string": {
"file": "extract",
"template": "Extract",
"params": [
12
12,
2
]
},
"value_number": {
"file": "extract",
"template": "Extract",
"params": [
12
12,
2
]
},
"value_array": {
"file": "extract",
"template": "Extract",
"params": [
18
18,
3
]
},
"value_object": {
"file": "extract",
"template": "Extract",
"params": [
21
21,
4
]
}
}
5 changes: 2 additions & 3 deletions circuits/extract.circom
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ pragma circom 2.1.9;
include "utils.circom";
include "parser.circom";

template Extract(DATA_BYTES) {
template Extract(DATA_BYTES, MAX_STACK_HEIGHT) {
signal input data[DATA_BYTES];

// TODO: Add assertions on the inputs here!
Expand All @@ -14,7 +14,6 @@ template Extract(DATA_BYTES) {
component dataASCII = ASCII(DATA_BYTES);
dataASCII.in <== data;
//--------------------------------------------------------------------------------------------//
var MAX_STACK_HEIGHT = 16;
// Initialze the parser
component State[DATA_BYTES];
State[0] = StateUpdate(MAX_STACK_HEIGHT);
Expand Down Expand Up @@ -50,7 +49,7 @@ template Extract(DATA_BYTES) {

// Debugging
log("State[", DATA_BYTES, "].pointer ", "= ", State[DATA_BYTES -1].next_pointer);
for(var i = 0; i<4; i++) {
for(var i = 0; i < MAX_STACK_HEIGHT; i++) {
log("State[", DATA_BYTES, "].stack[", i,"] ", "= ", State[DATA_BYTES -1 ].next_stack[i]);
}
log("State[", DATA_BYTES, "].parsing_string", "= ", State[DATA_BYTES-1].next_parsing_string);
Expand Down

0 comments on commit ccb86bf

Please sign in to comment.