Initializacia
This commit is contained in:
parent
138c5f4e91
commit
647c26db9a
@ -44,11 +44,14 @@ void check_brackets(const char *line) {
|
||||
return;
|
||||
}
|
||||
} else if (is_closing(ch)) {
|
||||
if (stack_top >= 0 && stack[stack_top].bracket == matching_bracket(ch)) {
|
||||
if (stack_top == -1) {
|
||||
printf("Unexpected closing bracket %c in %d\n", ch, i);
|
||||
return;
|
||||
} else if (stack[stack_top].bracket == matching_bracket(ch)) {
|
||||
stack_top--;
|
||||
} else {
|
||||
printf("Crossed bracket %c in %d, expected %c\n", ch, i,
|
||||
stack_top >= 0 ? matching_bracket(stack[stack_top].bracket) : '#');
|
||||
matching_bracket(stack[stack_top].bracket));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user