Tring harder

This commit is contained in:
Anton Dolozin 2025-10-13 15:12:50 +02:00
parent 2cbfbb835f
commit f705e90a84

View File

@ -2,6 +2,8 @@
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#include <ctype.h>
#include <locale.h>
#define BRACKETS_NUM 100
typedef struct Node{
@ -79,7 +81,11 @@ void read_input(LinkedNode** head){
}
char popped = pop(head);
if (!compare(popped, buff[i]))
{ if (popped == '[' && buff[i] == '>')
{ if(popped == '[' && isalpha(buff[i])){
printf("Read: %sMissing brackets: ]", buff);
return;
}
if (popped == '[' && buff[i] == '>')
{
printf("Read: %s\n", buff);
printf("Crossed bracket %c", buff[i]);
@ -178,8 +184,18 @@ void read_input(LinkedNode** head){
return;
}
}
}
if(*head != NULL){
if (buff[i] == '[')
{
printf("Read: %sMissing closing bracket: ]\n", buff);
return;
}
}
i++;