try3
This commit is contained in:
parent
559203566a
commit
3575505ab5
@ -80,7 +80,11 @@ int main() {
|
|||||||
}
|
}
|
||||||
char c = input[err - 1];
|
char c = input[err - 1];
|
||||||
if (c == ')' || c == ']' || c == '}' || c == '>') {
|
if (c == ')' || c == ']' || c == '}' || c == '>') {
|
||||||
printf("Crossed bracket %c in %d, expected %c\n", c, err-1, getExpectedClosing(stack[top]));
|
if (top <-1) {
|
||||||
|
printf("Unexpected closing bracket %c at position %d\n", c, err-1);
|
||||||
|
} else {
|
||||||
|
printf("Crossed bracket %c at position %d, expected %c\n", c, err-1, getExpectedClosing(stack[top]));
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("Unclosed bracket %c in %d\n", stack[top], err-1);
|
printf("Unclosed bracket %c in %d\n", stack[top], err-1);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user