编译ciruits并打算使用quickfix。但编译器输出不是标准格式...所以尝试解析
需要帮忙
- 修复 sed 命令
- 准备错误格式的输出,以便我可以使用 quikfix 窗口
问题
- circom 编译器输出一堆颜色的 ascii 代码。由终端解析但是
[0m[1m[38;5;9merror[P1000][0m[1m: UnrecognizedToken { token: (374, Token(60, "input"), 379), expected: ["\"!=\"", "\"%\"", "\"%=\"", "\"&\"", "\"&&\"", "\"&=\"", "\"(\"", "\")\"", "\"*\"", "\"**\"", "\"**=\"", "\"*=\"", "\"+\"", "\"++\"", "\"+=\"", "\",\"", "\"-\"", "\"--\"", "\"-->\"", "\"-=\"", "\".\"", "\"/\"", "\"/=\"", "\":\"", "\";\"", "\"<\"", "\"<--\"", "\"<<\"", "\"<<=\"", "\"<=\"", "\"<==\"", "\"=\"", "\"==\"", "\"===\"", "\"==>\"", "\">\"", "\">=\"", "\">>\"", "\">>=\"", "\"?\"", "\"[\"", "\"\\\\\"", "\"\\\\=\"", "\"]\"", "\"^\"", "\"^=\"", "\"|\"", "\"|=\"", "\"||\""] }[0m
[0m[34m┌─[0m "merkleTreeUpdater.circom":10:13
[0m[34m│[0m
[0m[34m10[0m [0m[34m│[0m ssignal [0m[31minput[0m oldRoot;
[0m[34m│[0m [0m[31m^^^^^[0m [0m[31mInvalid syntax[0m
[31mprevious errors were found[0m
我无法正确解析
error[P1000]: UnrecognizedToken { token: (374, Token(60, "input"), 379), expected: ["\"!=\"", "\"%\"", "\"%=\"", "\"&\"", "\"&&\"", "\"&=\"", "\"(\"", "\")\"", "\"*\"", "\"**\"", "\"**=\"", "\"*=\"", "\"+\"", "\"++\"", "\"+=\"", "\",\"", "\"-\"", "\"--\"", "\"-->\"", "\"-=\"", "\".\"", "\"/\"", "\"/=\"", "\":\"", "\";\"", "\"<\"", "\"<--\"", "\"<<\"", "\"<<=\"", "\"<=\"", "\"<==\"", "\"=\"", "\"==\"", "\"===\"", "\"==>\"", "\">\"", "\">=\"", "\">>\"", "\">>=\"", "\"?\"", "\"[\"", "\"\\\\\"", "\"\\\\=\"", "\"]\"",
"\"^\"", "\"^=\"", "\"|\"", "\"|=\"", "\"||\""] }
┌─ "merkleTreeUpdater.circom":10:13
│
10 │ ssignal input oldRoot;
│ ^^^^^ Invalid syntax
previous errors were found
尝试解析它errorformat
circom merkleTreeUpdater.circom &> >( tr -d '\n' | (sed 's/\x1B[@A-Z\\\]^_]\|\x1B\[[0-9:;<=>?]*[-!"#$%&'"'"'()*+,.\/]*[][\\@A-Z^_`a-z{|}~]//g') | (sed "s/{.*}//g") | (sed 's/\s*//g')| sed 's/^.*\]\://g' | sed 's/\(^.*\:\).*/\1/g' | sed 's/"//g' | tr -s '[\200-\377]' :)
输出:
UnrecognizedToken:merkleTreeUpdater.circom:10:
我可以设置错误格式,但遇到问题makeprg
并且 nvim 退出