Comments (3)
Here is the minimal example
{
char* temp = Fr_element2str(&signalValues[mySignalStart + 1]);
printf("%s",temp);
delete [] temp;
}
and this sed
from the script removes the }
sed -e 's/FrElement\* signalValues/rust::Vec<FrElement> \&signalValues/g' \
-e 's/std::string/rust::string/g' \
-e 's/ctx->templateInsId2IOSignalInfo/IOSignalInfoAccessor(ctx)/g' \
-e 's/u32\* mySubcomponents/rust::Vec<u32> mySubcomponents/g' \
-e 's/FrElement\* circuitConstants/rust::Vec<FrElement> \&circuitConstants/g' \
-e 's/rust::string\* listOfTemplateMessages/rust::Vec<rust::string> \&listOfTemplateMessages/g' \
-e 's/FrElement expaux\[\([0-9]*\)\];/rust::Vec<FrElement> expaux = create_vec(\1);/g' \
-e 's/FrElement lvar\[\([0-9]*\)\];/rust::Vec<FrElement> lvar = create_vec(\1);/g' \
-e 's/FrElement lvarcall\[\([0-9]*\)\];/rust::Vec<FrElement> lvarcall = create_vec(\1);/g' \
-e 's/PFrElement aux_dest/FrElement \*aux_dest/g' \
-e 's/subcomponents = new uint\[\([0-9]*\)\];/subcomponents = create_vec_u32(\1);/g' \
-e '/trace/d' \
-e 's/\(ctx,\)\(lvarcall,\)\(myId,\)/\1\&\2\3/g' \
-e '/^#include/d' \
-e '/assert/d' \
-e '/mySubcomponentsParallel/d' \
-e 's/FrElement lvarcall\[\([0-9]*\)\];/rust::Vec<FrElement> lvarcall = create_vec(\1);/g' \
-e 's/,FrElement\* lvar,/,rust::Vec<FrElement>\& lvar,/g' \
-e 's/ctx,\&lvarcall,myId,/ctx,lvarcall,myId,/g' \
-e '/delete/{N;d;}' -e 'N;/\ndelete/!P;D' \
-e '/^#include/d'
from circom-witness-rs.
The issue is with the sed
command /delete/{N;d;}
which is designed to match a line containing delete, read in the next line (with N
), and then delete both lines (with d
). However, this is too aggressive, it does not work for my case.
Can we modify the sed command like this?
sed -e '/delete \[\] [^;]*;/d'
This new pattern matches lines that contain delete []
followed by any number of characters that are not a semicolon (indicating the end of the statement) and then a semicolon, thus ensuring that only the line with the delete statement is removed. I checked and it supposedly works as intended
from circom-witness-rs.
this one is correct
-e '/delete \[\][^;]*;/d'
from circom-witness-rs.
Related Issues (8)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from circom-witness-rs.