> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 10:12:51 up 3 days,  3:15,  1 user,  load average: 0.44, 0.30, 0.17
This commit is contained in:
tracer-ics2023
2024-08-26 10:12:52 +08:00
committed by zzy
parent d3f6e6ef6f
commit 8376035bd7

View File

@ -143,7 +143,7 @@ static bool make_token(char *e) {
int check_parentheses(const Token* arr, size_t p, size_t q) {
int cnt = 0;
bool is_surrounded = arr[0].type == '(';
bool is_surrounded = arr[p].type == '(';
for (size_t i = p; i <= q; i ++) {
if (arr[i].type == '(') {
cnt ++;
@ -157,9 +157,6 @@ int check_parentheses(const Token* arr, size_t p, size_t q) {
is_surrounded &= i == q;
}
}
if (cnt != 0) {
return -1;
}
return !is_surrounded;
}