This commit is contained in:
Deinerovych 2024-10-29 15:01:24 +01:00
parent 9244a1e7da
commit b262b92ddd

View File

@ -31,7 +31,7 @@ void check_brackets(const char *code) {
} }
else if (ch == ')' || ch == '}' || ch == ']' || ch == '>') { else if (ch == ')' || ch == '}' || ch == ']' || ch == '>') {
if (top == -1) { if (top == -1) {
printf("Unmatched closing bracket %c at position %d\n", ch, i); printf("Unexpected closing bracket %c in %d\n", ch, i);
return; return;
} }
if (!is_matching_pair(stack[top], ch)) { if (!is_matching_pair(stack[top], ch)) {
@ -65,5 +65,4 @@ int main() {
} }
return 0; return 0;
}